dragonfly.git
12 years agotcp/sack: Cleanup the SACK related bits when return from tcp_input slow path
Sepherosa Ziehau [Fri, 6 Apr 2012 01:47:36 +0000 (09:47 +0800)]
tcp/sack: Cleanup the SACK related bits when return from tcp_input slow path

When the code path that could generate the invalid SACK block on out-of-order
FIN segment was walked through, it turned out that some SACK related bits
could be leftover from the previous input segment, e.g. SACKLEFT.

Since the observed invalid SACK option contains only one SACK block and the
block's right edge is same as its left edge, the code which can generate that
SACK block could be run only if SACKLEFT is turned on and reportblk's start
and end are same.
- If SACKLEFT is on then reportblk's start and end must not be same, so the
  SACKLEFT is leftover from the previous input segment.
- If KASSERTs about the clearance of the SACK bits are added immediately
  before returning from the tcp_input slow path, the KASSERTs could fail due
  to SACKLEFT are still on.

Obviously the SACK related bits are never intended to be inheritted from one
input segment to another input segment, so we just clear them before returning
from the tcp_input slow path.

12 years agotcp/sack: Take FIN bit into consideration when setup report SACK block end
Sepherosa Ziehau [Wed, 28 Mar 2012 08:17:32 +0000 (16:17 +0800)]
tcp/sack: Take FIN bit into consideration when setup report SACK block end

The invalid SACK option observed on the heavily segment reordering network
path (50% segments out of order) contains only one SACK block which tries
to cover the FIN segment but sets the right edge incorrectly, i.e. the right
edge is same as the left edge; mainly because the FIN bit is not counted.

12 years agoacpi_hp.4: List the HP Compaq nc6320 as tested with the acpi_hp(4) driver.
Sascha Wildner [Tue, 10 Apr 2012 19:46:27 +0000 (21:46 +0200)]
acpi_hp.4: List the HP Compaq nc6320 as tested with the acpi_hp(4) driver.

The reported values looked sane.

Tested-by: Andrea Magliano <masterblaster@tiscali.it>
12 years agoMerge branch 'vendor/OPENSSL'
Peter Avalos [Tue, 10 Apr 2012 17:28:26 +0000 (10:28 -0700)]
Merge branch 'vendor/OPENSSL'

12 years agoBring in the krb5 module in OpenSSL.
Peter Avalos [Tue, 10 Apr 2012 16:57:21 +0000 (09:57 -0700)]
Bring in the krb5 module in OpenSSL.

Even though we don't have Kerberos5 in base, we should still be
installing the krb5_asn.h header.

12 years agoMerge remote-tracking branch 'origin/master'
Peter Avalos [Tue, 10 Apr 2012 16:51:20 +0000 (09:51 -0700)]
Merge remote-tracking branch 'origin/master'

12 years agocarp: Lockless MPSAFE, step 11 of 11
Sepherosa Ziehau [Tue, 10 Apr 2012 13:26:53 +0000 (21:26 +0800)]
carp: Lockless MPSAFE, step 11 of 11

Remove big giant carp token.

12 years agocarp: Lock MPSAFE, step 10 of 11
Sepherosa Ziehau [Mon, 9 Apr 2012 13:06:57 +0000 (21:06 +0800)]
carp: Lock MPSAFE, step 10 of 11

Make carp_softc.sc_carpdev and ifnet.if_carp accessing and updating
lockless MPSAFE.

carp_softc.sc_carpdev:
- Reader of the sc_carpdev will cache the value in temporary variable
  and use the cached value instead of always accessing sc_carpdev,
  which may be inconsistent due to change of sc_carpdev.

ifnet.if_carp
- if_carp is a pointer to the carp_softc container list, while the list
  only contains pointer to carp_softc
- Reader of if_carp will cache the value in temporary variable and use
  the cached value instead of always accessing if_carp, which may be
  inconsistent due to if_carp updating.
- Updating of the if_carp is done in the following way:
    ocif = ifp->if_carp;
    ncif = cif_copy(ocif);
    cif_modify(ncif);
    ifp->if_carp = ncif;
    netmsg_service_sync();
    /* when we reach here all users of old if_carp (ocif) are done */
    cif_free(ocif)

12 years agopst(4): Add a missing contigfree().
Sascha Wildner [Mon, 9 Apr 2012 02:37:14 +0000 (04:37 +0200)]
pst(4): Add a missing contigfree().

12 years agomps(4): Add a missing kfree().
Sascha Wildner [Mon, 9 Apr 2012 01:31:45 +0000 (03:31 +0200)]
mps(4): Add a missing kfree().

12 years agokernel: Remove NULL checks after kmalloc() with M_WAITOK.
Sascha Wildner [Sun, 8 Apr 2012 23:28:51 +0000 (01:28 +0200)]
kernel: Remove NULL checks after kmalloc() with M_WAITOK.

12 years agoacpi_hp(4): Fix some previously overlooked issues.
Sascha Wildner [Sun, 8 Apr 2012 22:29:44 +0000 (00:29 +0200)]
acpi_hp(4): Fix some previously overlooked issues.

12 years agoIPXrouted(8): Re-indent some code to make the outer for() better visible.
Sascha Wildner [Sun, 8 Apr 2012 19:19:02 +0000 (21:19 +0200)]
IPXrouted(8): Re-indent some code to make the outer for() better visible.

12 years agocarp: Lockless MPSAFE step 9 of many
Sepherosa Ziehau [Sat, 7 Apr 2012 14:17:44 +0000 (22:17 +0800)]
carp: Lockless MPSAFE step 9 of many

Carry out timeout processing in netisr0

12 years agoDocument which drivers are using MSI and how it can be disabled.
Sascha Wildner [Sat, 7 Apr 2012 13:18:59 +0000 (15:18 +0200)]
Document which drivers are using MSI and how it can be disabled.

12 years agokernel/pci: Adjust MSI allocation verbose message a bit.
Sascha Wildner [Sat, 7 Apr 2012 12:36:54 +0000 (14:36 +0200)]
kernel/pci: Adjust MSI allocation verbose message a bit.

12 years agoarcmsr(4): Use the available dev variable (like bus_release_resource()).
Sascha Wildner [Sat, 7 Apr 2012 11:59:15 +0000 (13:59 +0200)]
arcmsr(4): Use the available dev variable (like bus_release_resource()).

12 years agoarcmsr(4): Add MODULE_VERSION.
Sascha Wildner [Sat, 7 Apr 2012 10:51:27 +0000 (12:51 +0200)]
arcmsr(4): Add MODULE_VERSION.

12 years agoarcmsr(4): Use MSI if it is supported by the device.
Sascha Wildner [Sat, 7 Apr 2012 10:50:02 +0000 (12:50 +0200)]
arcmsr(4): Use MSI if it is supported by the device.

12 years agokernel: Fix building with USERCONFIG but without VISUAL_USERCONFIG.
Sascha Wildner [Sat, 7 Apr 2012 11:15:38 +0000 (13:15 +0200)]
kernel: Fix building with USERCONFIG but without VISUAL_USERCONFIG.

Reported-by: v_2e on users@
12 years agoKernel - properly handle max. io size when dumping
François Tigeot [Sat, 7 Apr 2012 07:08:46 +0000 (09:08 +0200)]
Kernel - properly handle max. io size when dumping

* A magic constant was used to define the maximum IO size used when
  dumping core

* Stop this practice and use the information provided by the underlying
  device driver, capping the result to MAXPHYS if needed.

* This should fix issue #2343

12 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sat, 7 Apr 2012 02:17:29 +0000 (04:17 +0200)]
Update the pciconf(8) database.

Apr 4, 2012 snapshot from http://pciids.sourceforge.net/

12 years ago<machine/param.h>: Bring back the DFLTPHYS define.
Sascha Wildner [Fri, 6 Apr 2012 15:42:09 +0000 (17:42 +0200)]
<machine/param.h>: Bring back the DFLTPHYS define.

This is needed in pkgsrc, too, at least in graphics/sane-backends, which
is needed by KDE4 via ksaneplugin.

Until the impact on pkgsrc has been estimated and fixed, this define will
stay.

12 years agodlfcn: How weak!
John Marino [Fri, 6 Apr 2012 11:05:50 +0000 (13:05 +0200)]
dlfcn: How weak!

12 years agortld: Fix rtld_functrace
John Marino [Fri, 6 Apr 2012 08:08:47 +0000 (10:08 +0200)]
rtld: Fix rtld_functrace

The replacement for the do_reloc functionality wasn't properly implemented
in commit 35b2b265aa300727e840990e41e604edb8b25314

Reported-by: swildner
12 years agortld: Implement fdlopen(3)
John Marino [Fri, 6 Apr 2012 07:33:33 +0000 (09:33 +0200)]
rtld: Implement fdlopen(3)

Implement rtld interface fdlopen.  It is similar to dlopen, but takes a
file description instead of a path to reference the shared object.

Taken from: FreeBSD SVN 229768 (07 JAN 2012)

12 years agoigb: Always prepare for vlan when setup reception unit
Sepherosa Ziehau [Fri, 6 Apr 2012 09:30:34 +0000 (17:30 +0800)]
igb: Always prepare for vlan when setup reception unit

vlan could be added after igb is initialized/brought up.

12 years agoigb: vlan could detect that the parent interface is gone; don't prevent detach
Sepherosa Ziehau [Fri, 6 Apr 2012 09:27:58 +0000 (17:27 +0800)]
igb: vlan could detect that the parent interface is gone; don't prevent detach

12 years agocarp: Lockless MPSAFE step 8 of many
Sepherosa Ziehau [Fri, 6 Apr 2012 09:08:26 +0000 (17:08 +0800)]
carp: Lockless MPSAFE step 8 of many

Dispatch virtual host addresses' extraction into netisr0

12 years agocarp: Cleanup, move most of the code left in ioctl into sub-ioctl functions
Sepherosa Ziehau [Fri, 6 Apr 2012 08:37:08 +0000 (16:37 +0800)]
carp: Cleanup, move most of the code left in ioctl into sub-ioctl functions

12 years agocarp: Lockless MPSAFE step 7 of many
Sepherosa Ziehau [Fri, 6 Apr 2012 08:09:58 +0000 (16:09 +0800)]
carp: Lockless MPSAFE step 7 of many

Dispatch backing device's name extraction into netisr0

12 years agocarp: In ioctl, we have to recompute HMAC only if any configures are changed
Sepherosa Ziehau [Fri, 6 Apr 2012 05:27:55 +0000 (13:27 +0800)]
carp: In ioctl, we have to recompute HMAC only if any configures are changed

12 years agonetstat: Reduce SACK scoreboard statistics description verbosity
Sepherosa Ziehau [Fri, 6 Apr 2012 04:57:17 +0000 (12:57 +0800)]
netstat: Reduce SACK scoreboard statistics description verbosity

12 years agodsched.9: A little mdoc correction.
Sascha Wildner [Thu, 5 Apr 2012 19:48:35 +0000 (21:48 +0200)]
dsched.9: A little mdoc correction.

12 years agokernel/ufs: Fix compilation without INVARIANTS.
Sascha Wildner [Thu, 5 Apr 2012 17:10:51 +0000 (19:10 +0200)]
kernel/ufs: Fix compilation without INVARIANTS.

12 years agoppp(8): Raise WARNS to 2 and fix the warnings.
Sascha Wildner [Thu, 5 Apr 2012 09:08:06 +0000 (11:08 +0200)]
ppp(8): Raise WARNS to 2 and fix the warnings.

12 years agokernel: Pass a real format string to functions which expect one.
Sascha Wildner [Wed, 4 Apr 2012 21:31:43 +0000 (23:31 +0200)]
kernel: Pass a real format string to functions which expect one.

This is safer than just passing a random string.

A few of these changes might be overly cautious but it doesn't
hurt to stick with using formats where they are expected more
or less generally.

12 years agobktr(4): Let kthread_create() construct the thread name.
Sascha Wildner [Wed, 4 Apr 2012 19:01:46 +0000 (21:01 +0200)]
bktr(4): Let kthread_create() construct the thread name.

12 years agokernel/acpi: Remove the redefinition of kthread_create().
Sascha Wildner [Wed, 4 Apr 2012 18:09:14 +0000 (20:09 +0200)]
kernel/acpi: Remove the redefinition of kthread_create().

It's a relict from an old pile of #ifdefs that defined various
incarnations of kthread_create()s for various FreeBSD versions.
The #ifdefs have since been removed and this #define is what
used to be the __DragonFly__ case.

There are only 3 places where kthread_create() is used in ACPI,
so remove it because it's just confusing.

While here, fix a non-constant format string in one of the
kthread_create()s.

12 years agocarp: Lockless MPSAFE step 6 of many
Sepherosa Ziehau [Wed, 4 Apr 2012 13:11:36 +0000 (21:11 +0800)]
carp: Lockless MPSAFE step 6 of many

Run the carp information retrieving code in netisr0

12 years agocarp: Lockless MPSAFE step 5 of many
Sepherosa Ziehau [Wed, 4 Apr 2012 12:41:06 +0000 (20:41 +0800)]
carp: Lockless MPSAFE step 5 of many

Dispatch SIOCSVH to netisr0 for further processing

12 years agocarp: Lockless MPSAFE step 4 of many
Sepherosa Ziehau [Wed, 4 Apr 2012 12:07:22 +0000 (20:07 +0800)]
carp: Lockless MPSAFE step 4 of many

Dispatch "stop" method from if_ioctl to netisr0 for further processing

12 years agocarp: Lockless MPSAFE step 3 of many
Sepherosa Ziehau [Wed, 4 Apr 2012 10:59:57 +0000 (18:59 +0800)]
carp: Lockless MPSAFE step 3 of many

Dispatch main part of if_init to netisr0 for further processing

12 years agocarp: Lockless MPSAFE step 2 of many
Sepherosa Ziehau [Wed, 4 Apr 2012 09:52:18 +0000 (17:52 +0800)]
carp: Lockless MPSAFE step 2 of many

Dispatch major part of clone_destroy to netisr0 for further processing

12 years agocarp: Lockless MPSAFE step 1 of many
Sepherosa Ziehau [Wed, 4 Apr 2012 09:26:36 +0000 (17:26 +0800)]
carp: Lockless MPSAFE step 1 of many

Dispatch ifnet_detach_event to netisr0 for further processing

12 years agopf/carp: Our carp is never layed out in the fashion used by pf
Sepherosa Ziehau [Tue, 3 Apr 2012 13:19:48 +0000 (21:19 +0800)]
pf/carp: Our carp is never layed out in the fashion used by pf

Comment out the invalid usage temporarily

12 years agocarp: Remove unused code
Sepherosa Ziehau [Tue, 3 Apr 2012 13:11:55 +0000 (21:11 +0800)]
carp: Remove unused code

12 years agocarp: Make sure that carp_ifaddr only happens in netisr0
Sepherosa Ziehau [Tue, 3 Apr 2012 12:57:15 +0000 (20:57 +0800)]
carp: Make sure that carp_ifaddr only happens in netisr0

12 years agokernel -- vnlru: Remove MPLOCK from vnlru.
Venkatesh Srinivas [Tue, 3 Apr 2012 03:59:20 +0000 (20:59 -0700)]
kernel -- vnlru: Remove MPLOCK from vnlru.

vnlru didn't need the mplock through its main loop.

12 years agovkernel: cap vdisk max. io size to MAXPHYS
François Tigeot [Mon, 2 Apr 2012 17:21:17 +0000 (19:21 +0200)]
vkernel: cap vdisk max. io size to MAXPHYS

12 years agokernel - Add max I/O size cap to vmaxiosize()
Matthew Dillon [Mon, 2 Apr 2012 17:16:21 +0000 (10:16 -0700)]
kernel - Add max I/O size cap to vmaxiosize()

* Cap the returned value at MAXPHYS, allowing VCHR devices to set a
  higher max-IO limit (according to DMA limitations) without blowing
  out the pbuf's that the frontend uses to build clustered I/O.

12 years agokernel - Reduce impact of write_behind on small/temporary files
Matthew Dillon [Mon, 2 Apr 2012 17:12:16 +0000 (10:12 -0700)]
kernel - Reduce impact of write_behind on small/temporary files

* Do not start issuing write-behind writes until a file has grown past
  a certain size, otherwise we wind up issuing excessive I/O for
  small files and for temporary files which might be quickly deleted.

* Add vfs.write_behind_minfilesize sysctl (defaults to 10MB).

12 years agokernel -- FFS: Take softdep lock in softdep_disk_io_initiation.
Venkatesh Srinivas [Mon, 2 Apr 2012 17:02:25 +0000 (10:02 -0700)]
kernel -- FFS: Take softdep lock in softdep_disk_io_initiation.

softdep_disk_io_initiation was using the mplock rather than the softdep
lock to protect the softdep work queue and items on it. Take the softdep
lock and allow it to be taken recursively, so that io_start bioops can
call into other parts of softdep. Prevents softdep completion callback
from racing softdep_disk_io_initiation, remaining panics of 2291.

Eventually the MPLOCK in the bio_ops callback can go away, but that will
require more testing.

Closes-bug: 2291

12 years agoSync zoneinfo database with tzdata2012c from munnari.oz.au
Sascha Wildner [Mon, 2 Apr 2012 08:21:42 +0000 (10:21 +0200)]
Sync zoneinfo database with tzdata2012c from munnari.oz.au

africa:         8.33 -> 8.35
asia:           8.70 -> 8.73
northamerica:   8.53 -> 8.54

* africa: Morocco 2012 DST from last Sunday in April through last
    Sunday in September.

* asia: Change start of DST in Syria to last Friday in March in
    2012 and (as a guess) forward. Starts and (guessed) ends of
    DST in West Bank and Gaza for 2012. Also add a missing HTML
    directive at the top of the file.

* northamerica: Start and end of DST in Haiti in 2012 according
    to US rules.

12 years agoKernel: Set max io size limit for all disk devices
François Tigeot [Mon, 2 Apr 2012 06:34:35 +0000 (08:34 +0200)]
Kernel: Set max io size limit for all disk devices

* Prior to this change, slice and partition devices did not inherit their
  parent maximum IO size limit

* IO transactions on these devices could thus never be bigger than the
  old 64KB DFLTPHYS defaul kernel limit

12 years agofsstress: Adjust the sample script a bit.
Sascha Wildner [Sun, 1 Apr 2012 10:10:08 +0000 (12:10 +0200)]
fsstress: Adjust the sample script a bit.

12 years agoHAMMER VFS - Fix assertion with multi-volume setup
Matthew Dillon [Sun, 1 Apr 2012 01:35:33 +0000 (18:35 -0700)]
HAMMER VFS - Fix assertion with multi-volume setup

* The RB compare code for hammer_io was extracting the volume number
  from the wrong place, creating a situation where duplicate hammer_io's
  would sometimes be inserted in the RB tree (causing an assertion + panic).

* Pull the volume number from a different field.

Reported-by: Mark Saad <nonesuch@longcount.org>
12 years agokernel - Do not use M_USE_INTERRUPT_RESERVE for M_NOWAIT
Matthew Dillon [Sun, 1 Apr 2012 01:33:59 +0000 (18:33 -0700)]
kernel - Do not use M_USE_INTERRUPT_RESERVE for M_NOWAIT

* Redefine M_NOWAIT to not use M_USE_INTERRUPT_RESERVE.  This can result
  in mbuf exhaustion during bursts of mbuf allocations and cause kernel
  kvm expansion to assert and panic.

Reported-by: sephe
12 years agokernel - Fix signal masking race assertion panic w/vkernel
Matthew Dillon [Sun, 1 Apr 2012 01:30:13 +0000 (18:30 -0700)]
kernel - Fix signal masking race assertion panic w/vkernel

* sigsuspend() and pselect() record the old signal mask in order to
  allow an interrupting signal to run its handler before the old mask
  is restored.

* When multiple threads are present a race can ensue where another thread
  changes the signal handler after sigsuspend() or pselect() have interrupted,
  but before they are able to process the signal.

* If the signal is no longer enabled the old signal mask is not restored
  on system call return, resulting in an assertion and panic.

* Fix the problem by checking the flag and restoring the old signal mask
  on return (rather than asserting when the flag is found to be non-zero
  on return).

Reported-by: Venkatesh Srinivas
12 years agolibm: Fix a typo in the MLINKS.
Sascha Wildner [Sat, 31 Mar 2012 22:22:46 +0000 (00:22 +0200)]
libm: Fix a typo in the MLINKS.

12 years agoFix some indentation in various places.
Sascha Wildner [Sat, 31 Mar 2012 18:34:05 +0000 (20:34 +0200)]
Fix some indentation in various places.

12 years agoKernel - Restore the 64KB max. IO size limit
François Tigeot [Sat, 31 Mar 2012 18:23:56 +0000 (20:23 +0200)]
Kernel - Restore the 64KB max. IO size limit

* Some drivers and part of the kernel are dependent on an implicit
  64KB maximum IO size limit

* Explicitely set it to 64KB (or MAXPHYS if it is smaller) for devices
  which do not report a default value

* This should fix ATA DMA errors reported in issue #2342

12 years agoaic(4): Remove ISA attachment.
Sascha Wildner [Sat, 31 Mar 2012 14:48:23 +0000 (16:48 +0200)]
aic(4): Remove ISA attachment.

The only support that remains (and works) is for AHA-1460 PC Card adapters.

While here, reduce differences with FreeBSD a bit.

12 years agoVFS accounting: avoid VOP_GETATTR() calls
François Tigeot [Fri, 30 Mar 2012 21:09:51 +0000 (23:09 +0200)]
VFS accounting: avoid VOP_GETATTR() calls

* Only use them if VFS accounting is not disabled

12 years agoasr(4): Improve readability of an 'if' a bit.
Sascha Wildner [Sat, 31 Mar 2012 03:24:38 +0000 (05:24 +0200)]
asr(4): Improve readability of an 'if' a bit.

12 years agomfi(4): Fix indent.
Sascha Wildner [Sat, 31 Mar 2012 03:19:25 +0000 (05:19 +0200)]
mfi(4): Fix indent.

12 years agorp(4): Fix indent.
Sascha Wildner [Sat, 31 Mar 2012 02:44:50 +0000 (04:44 +0200)]
rp(4): Fix indent.

12 years agopcn(4): Add missing braces.
Sascha Wildner [Sat, 31 Mar 2012 02:10:59 +0000 (04:10 +0200)]
pcn(4): Add missing braces.

12 years agolgue(4): Add missing braces and fix indentation.
Sascha Wildner [Sat, 31 Mar 2012 01:46:53 +0000 (03:46 +0200)]
lgue(4): Add missing braces and fix indentation.

It was returning too early in some cases.

While here, add an error message.

12 years agokernel/netgraph7: Fix whitespace.
Sascha Wildner [Sat, 31 Mar 2012 01:30:32 +0000 (03:30 +0200)]
kernel/netgraph7: Fix whitespace.

12 years agokernel: Indent a debugging kprintf.
Sascha Wildner [Sat, 31 Mar 2012 01:30:07 +0000 (03:30 +0200)]
kernel: Indent a debugging kprintf.

12 years agohptiop(4): Add missing braces.
Sascha Wildner [Sat, 31 Mar 2012 01:26:52 +0000 (03:26 +0200)]
hptiop(4): Add missing braces.

12 years agokernel: Adjust some casts.
Sascha Wildner [Sat, 31 Mar 2012 01:20:34 +0000 (03:20 +0200)]
kernel: Adjust some casts.

12 years agoKernel - Completely remove DFLTPHYS
François Tigeot [Thu, 22 Mar 2012 18:17:48 +0000 (19:17 +0100)]
Kernel - Completely remove DFLTPHYS

* There is no need to have two different macros define the maximum
  allowed IO size for low-level operations; replace DFLTPHYS by
  MAXPHYS in the entire kernel.

* Old drivers typically used DFLTPHYS without a second thought,
  assuming it would always be the same value; they may have hard
  limitations and break if bigger I/O sizes are suddenly used.
  Be sure to explicitely limit their maximum allowed I/O size to
  64KB and keep them working.

12 years agortld: allocate obj->vertab only once
John Marino [Fri, 30 Mar 2012 18:07:35 +0000 (20:07 +0200)]
rtld: allocate obj->vertab only once

Verbatim from FreeBSD SVN 233546 (27 MAR 2012)

Prevent rtld_verify_object_versions() from being called several times for
the same object. This can happen when object is a dependency of the
dlopen()ed dso. When called several times, we waste time due to unneeded
processing, and memory, because obj->vertab is allocated anew on each
iteration.

12 years agoVFS accounting: do not count write operations for removed files
Francois Tigeot [Fri, 30 Mar 2012 08:52:07 +0000 (10:52 +0200)]
VFS accounting: do not count write operations for removed files

* vnode operations can and do happen out-of-order in some circumstances
  (multi-job builds with make for example)

* check if the vnode has at least one associated link to be sure it
  still corresponds to an existing file

* do not count the write operation if this is not the case

12 years agomfiutil(8): Fix some 'unused variable' warnings and raise WARNS to 6.
Sascha Wildner [Fri, 30 Mar 2012 16:38:54 +0000 (18:38 +0200)]
mfiutil(8): Fix some 'unused variable' warnings and raise WARNS to 6.

12 years agorwhod(8): Prevent clobbering the neighboring field by a wrong cast.
Sascha Wildner [Fri, 30 Mar 2012 16:36:50 +0000 (18:36 +0200)]
rwhod(8): Prevent clobbering the neighboring field by a wrong cast.

The time stamps in the rwhod(8) network datagram and, based on that,
/var/rwho/whod.* spool files are typed as 32bit int and cannot accept
a 64bit time_t.

The old code clobbered the first bytes of the adjacent "hostname"
field, yielding empty hostnames in local rwho(1) and ruptime(1) output.
(Outgoing datagrams to other hosts were not affected.)

Re-code to let the compiler do the proper coercion (well, until 2038).

Submitted-by: Martin Neitzel
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2339>

12 years agoVFS accounting: small speed optimization
Francois Tigeot [Wed, 28 Mar 2012 11:52:36 +0000 (13:52 +0200)]
VFS accounting: small speed optimization

* Some operations may end up using the accounting macro with an
  effective zero bytes space usage difference

* Avoid calling the whole mess and its associated mount-point spinlock
  in that case.

12 years agokernel -- ffs: Do not dereference NULL inodes in ffs_sync_scan1.
Venkatesh Srinivas [Fri, 30 Mar 2012 06:33:08 +0000 (23:33 -0700)]
kernel -- ffs: Do not dereference NULL inodes in ffs_sync_scan1.

ffs_sync_scan1 is a fast callback from vmntvnodescan; it is not called
with vnodes locked. It is possible for an ffs_reclaim to have reclaimed
the vnode in question, NULL-ing out ip, without having removed the vnode
from the per-mount list. If we see a NULL inode, return failure from the
fast callback.

12 years agokern.cp_time - Add convenience defines
Samuel J. Greear [Fri, 30 Mar 2012 03:27:09 +0000 (21:27 -0600)]
kern.cp_time - Add convenience defines

* Add convenience defines for indexes of the array returned by the kern.cp_time
  sysctl.

* This sync's us with FreeBSD and should un-break and couple of pkgsrc
  packages.

12 years agoUpdate files for OpenSSL-1.0.1 update.
Peter Avalos [Wed, 28 Mar 2012 00:04:42 +0000 (17:04 -0700)]
Update files for OpenSSL-1.0.1 update.

This commit changes the order of sources in Makefiles to better conform
to what's in the OpenSSL distribution.  This should make it easier to
update the build system for future imports.

12 years agomfi(4): Update to LSI's version 4.23 of the driver.
Sascha Wildner [Thu, 29 Mar 2012 18:05:12 +0000 (20:05 +0200)]
mfi(4): Update to LSI's version 4.23 of the driver.

Brings in support for newer SAS2208 (aka Thunderbolt) based
controllers. It was tested with an Intel RS25DB080.

A few other things have been fixed too. Most x86_64/i386 specific
parts have been merged, MSI is now setup in mfi_pci.c properly.

Taken-from: FreeBSD (from their projects/ repository)

12 years agopuffs_framebuf.3: Fix typo
Sascha Wildner [Thu, 29 Mar 2012 14:13:56 +0000 (16:13 +0200)]
puffs_framebuf.3: Fix typo

12 years agopuffs_ops.3: Fix typo.
Sascha Wildner [Thu, 29 Mar 2012 13:25:12 +0000 (15:25 +0200)]
puffs_ops.3: Fix typo.

12 years agokernel -- ffs: Replace softupdates critical section locks with lockmgr.
Venkatesh Srinivas [Wed, 28 Mar 2012 18:09:15 +0000 (11:09 -0700)]
kernel -- ffs: Replace softupdates critical section locks  with lockmgr.

ffs softupdates was using a combination of critical sections and the mplock
to construct its acquire_lock/free_lock/interlocked_sleep primitives.

The softupdates I/O completion callback had a few points where it could block,
causing it to lose the mplock and any critical sections it held. When it did
so, front-end softupdates code would try to grab the lock but panic on seeing
the I/O completion callback in progress. This was not a problem in older
systems, as splx() would prevent the I/O callback from starting while
softdep code was executing.

This patch converts to using hard locks (lockmgr), which are held even while
a thread is blocked.

getdirtybuf(), locking a dirty buffer via BUF_LOCK, was changed to not
deadlock against the I/O completion path; specifically it drops the softdep
lock when its non-blocking attempt to lock a dirty buffer fails. One caller
of getdirtybuf() also required changes to retry locking buffers.

Closes-bug: 2291
Partially-from: FreeBSD r140709
Reported-by: tuxillo, marino, Rumko, vsrinivas
Discussed-with: dillon

12 years agoVFS accounting: use vq_vptomp() in kern_ftruncate()
Francois Tigeot [Wed, 28 Mar 2012 11:22:56 +0000 (13:22 +0200)]
VFS accounting: use vq_vptomp() in kern_ftruncate()

* Getting the needed struct mp* from curthread is not a good idea,
  the chain of dependencies is complex and may cause problems.

* Use vq_vptomp() to get it from the vnode we're using instead.

12 years agonetstat: Print SACK related statistics
Sepherosa Ziehau [Wed, 28 Mar 2012 03:23:36 +0000 (11:23 +0800)]
netstat: Print SACK related statistics

While I'm here, indent syncookie statistics into syncache statistics block.

12 years agotcp/sack: Add more statistics
Sepherosa Ziehau [Tue, 27 Mar 2012 01:54:55 +0000 (09:54 +0800)]
tcp/sack: Add more statistics

12 years agokernel - Revert 0d52e78c527ec7ba3ac62d40d9fa588c964d4c55
Matthew Dillon [Wed, 28 Mar 2012 02:11:22 +0000 (19:11 -0700)]
kernel - Revert 0d52e78c527ec7ba3ac62d40d9fa588c964d4c55

* Revert allowance of spinlocks when doing a lockmgr LK_RELEASE operation.
  Spinlocks must not be allowed for release operations due to the possibility
  of a livelock in the IPI code if wakeup() is called.

12 years agokernel - Fix improper BUF_UNLOCK() with spinlock held
Matthew Dillon [Wed, 28 Mar 2012 02:10:14 +0000 (19:10 -0700)]
kernel - Fix improper BUF_UNLOCK() with spinlock held

* Fix improper BUF_UNLOCK()s in the buf daemon threads.  Use a
  marker and rearrange the code to release the spinlock before
  executing BUF_UNLOCK().

12 years agoMerge branch 'vendor/OPENSSL'
Peter Avalos [Tue, 27 Mar 2012 23:47:37 +0000 (16:47 -0700)]
Merge branch 'vendor/OPENSSL'

12 years agoImport OpenSSL-1.0.1.
Peter Avalos [Sun, 25 Mar 2012 17:44:51 +0000 (10:44 -0700)]
Import OpenSSL-1.0.1.

  Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.1:

      o TLS/DTLS heartbeat support.
      o SCTP support.
      o RFC 5705 TLS key material exporter.
      o RFC 5764 DTLS-SRTP negotiation.
      o Next Protocol Negotiation.
      o PSS signatures in certificates, requests and CRLs.
      o Support for password based recipient info for CMS.
      o Support TLS v1.2 and TLS v1.1.
      o Preliminary FIPS capability for unvalidated 2.0 FIPS module.
      o SRP support.

  Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h:

      o Fix for CMS/PKCS#7 MMA CVE-2012-0884
      o Corrected fix for CVE-2011-4619
      o Various DTLS fixes.

12 years agokernel -- DEBUG_LOCKS: Do not panic if releasing a lockmgr lock w/ spinlocks held.
Venkatesh Srinivas [Tue, 27 Mar 2012 14:55:17 +0000 (07:55 -0700)]
kernel -- DEBUG_LOCKS: Do not panic if releasing a lockmgr lock w/ spinlocks held.

12 years agomountlist_exists(): use a TAILQ_FOREACH macro again
Francois Tigeot [Mon, 26 Mar 2012 17:58:30 +0000 (19:58 +0200)]
mountlist_exists(): use a TAILQ_FOREACH macro again

Removing a few lines of code in the process.

12 years agokernel: msdosfs -- Use -1 rather than 32-bit 0xffffffff in mount().
Venkatesh Srinivas [Mon, 26 Mar 2012 15:59:02 +0000 (08:59 -0700)]
kernel: msdosfs -- Use -1 rather than 32-bit 0xffffffff in mount().

Corrects bug mounting 8GB msdosfs filesystem on x86-64.

Submitted-by: G. Isenmann
12 years agotcp: Properly update tcps_rttcantdetect
Sepherosa Ziehau [Mon, 26 Mar 2012 05:39:10 +0000 (13:39 +0800)]
tcp: Properly update tcps_rttcantdetect

- Fix the logic which detects that RTT based spurious retransmition
  detection does not work.
- Add missing tcps_rttcantdetect updating in header prediction code

12 years agonetstat: Print the statistics that Eifel works but RTT based spurious rexmt not
Sepherosa Ziehau [Mon, 26 Mar 2012 05:37:46 +0000 (13:37 +0800)]
netstat: Print the statistics that Eifel works but RTT based spurious rexmt not

12 years agotcp/sack: Prevent invalid SACK option from being processed
Sepherosa Ziehau [Mon, 26 Mar 2012 03:36:53 +0000 (11:36 +0800)]
tcp/sack: Prevent invalid SACK option from being processed

If the received SACK blocks contain one invalid SACK block,
discard the whole SACK blocks.

12 years agoacpi_hp(4): Fix acquisition of acpi's softc.
Sascha Wildner [Sun, 25 Mar 2012 12:34:03 +0000 (14:34 +0200)]
acpi_hp(4): Fix acquisition of acpi's softc.

Now that acpi_hp is acpi_wmi's child, the softc must be taken from
its grandparent (acpi).

This fixes a crash in the setup of the sysctl tree.

Reported-by: tuxillo