6 years agokernel: mfs -- Fix unmount panic for MFS filesystems.
Venkatesh Srinivas [Thu, 16 Feb 2012 15:53:22 +0000 (07:53 -0800)]
kernel: mfs -- Fix unmount panic for MFS filesystems.

mfs_start() is active for the life of an MFS mount, handling copyin/out
requests. It is directed to exit when an MFS filesystem is unmounted.
The VFS accounting code and VFS MPLOCK code assumed that the mountpoint
structure was stable on return of mfs_start, which was not the case.

To work around that, don't call acinit if the vfs_start vfsop returns
EMOUNTEXIT, a kernel-specific pseudo-errno. Also allow marking vfs_start
MPSAFE and mark mfs vfs_start MPSAFE, to avoid accessing a per-mount
token field. A future commit will rework MFS's locking so that critical
sections are not used to protect the MFS bioq.

This is a hack for MFS; future work should either rework the filesystem
or replace it outright with tmpfs.

Closes: Bug 2276

6 years agoisp(4): Fix wrong sizeof().
Sascha Wildner [Thu, 16 Feb 2012 14:48:27 +0000 (15:48 +0100)]
isp(4): Fix wrong sizeof().

6 years agokernel/pci: Implement the PCIOCATTACHED ioctl.
Sascha Wildner [Tue, 14 Feb 2012 22:18:33 +0000 (23:18 +0100)]
kernel/pci: Implement the PCIOCATTACHED ioctl.

This fixes pciconf -a

Taken-from: FreeBSD

6 years agoobjformat - Duplicate NELEM() macro
Samuel J. Greear [Sun, 12 Feb 2012 18:24:26 +0000 (11:24 -0700)]
objformat - Duplicate NELEM() macro

* Fix buildworld on DragonFly hosts built before Dec 18, 2010 (2.9).

* NELEM() macro was added to sys/param.h on Dec 18, 2010 and objformat was
  made to use it on May 20, 2011. This broke upgrades for machines running a
  DragonFly version built prior to Dec 18, 2010 since objformat is built with
  the hosts headers as part of the cross tools stage.

6 years agomps(4): Add module version.
Sascha Wildner [Wed, 8 Feb 2012 20:40:35 +0000 (21:40 +0100)]
mps(4): Add module version.

6 years agomps(4): Mark a function __printflike() and fix a resulting warning.
Sascha Wildner [Wed, 8 Feb 2012 11:01:20 +0000 (12:01 +0100)]
mps(4): Mark a function __printflike() and fix a resulting warning.

6 years agomps(4): Remove some useless casts.
Sascha Wildner [Tue, 7 Feb 2012 10:53:42 +0000 (11:53 +0100)]
mps(4): Remove some useless casts.

I've inserted them by mistake because I had not realized that the
wrong typedefs for U32 and S32 were the real issue.

6 years agomps: Hold lock for the shutdown event handler
Sepherosa Ziehau [Tue, 7 Feb 2012 09:36:19 +0000 (17:36 +0800)]
mps: Hold lock for the shutdown event handler

6 years agomps: If we don't have enough space for a sge and chain, don't claim we can
Sepherosa Ziehau [Tue, 7 Feb 2012 09:35:20 +0000 (17:35 +0800)]
mps: If we don't have enough space for a sge and chain, don't claim we can

6 years agomps: Use WAITOK to allocate critical data struct on attach path
Sepherosa Ziehau [Tue, 7 Feb 2012 09:17:55 +0000 (17:17 +0800)]
mps: Use WAITOK to allocate critical data struct on attach path

6 years agomps: Properly define U32 and S32
Sepherosa Ziehau [Tue, 7 Feb 2012 09:15:45 +0000 (17:15 +0800)]
mps: Properly define U32 and S32

6 years agomps.4: Document how we disable MSI and comment out MSI-X documentation.
Sascha Wildner [Tue, 7 Feb 2012 08:50:08 +0000 (09:50 +0100)]
mps.4: Document how we disable MSI and comment out MSI-X documentation.

6 years agomps(4): Sync with FreeBSD.
Sascha Wildner [Tue, 7 Feb 2012 08:42:32 +0000 (09:42 +0100)]
mps(4): Sync with FreeBSD.

This a still in progress port of the new, LSI-supported version of the
mps(4) driver from FreeBSD.

Some of the changes are (from FreeBSD's commit msg):

- Integrated RAID (IR) support.
- Support for WarpDrive controllers.
- Support for SCSI protection information (EEDP).
- Support for TLR (Transport Level Retries), needed for tape drives.
- Improved error recovery code.
- ioctl interface compatible with LSI utilities.

This commit also moves the driver from sys/dev/disk to sys/dev/raid.

It still fails attaching at this stage. Work on it will continue in

6 years agokernel - Adjust tmpfs to use the new PG_NEED_COMMIT flag
Matthew Dillon [Wed, 1 Feb 2012 04:46:01 +0000 (20:46 -0800)]
kernel - Adjust tmpfs to use the new PG_NEED_COMMIT flag

* Adjust tmpfs to use vm_page_need_commit() instead of redirtying VM
  pages in its strategy code.

* The new mechanism also allows the pageout daemon to act more naturally
  when flushing clean pages with PG_NEED_COMMIT set.

* May fix some tmpfs corruption issues

Reported-by: tuxillo
6 years agokernel - Add vm_page_need_commit() and vm_page_clear_commit()
Matthew Dillon [Wed, 1 Feb 2012 04:41:57 +0000 (20:41 -0800)]
kernel - Add vm_page_need_commit() and vm_page_clear_commit()

* Add vm_page_need_commit() and vm_page_clear_commit().  This controls the
  PG_NEED_COMMIT flag on individual VM pages.

  When set a clean VM page cannot be reused and is still subject to
  flushing by the pageout daemon.

* Refactor buwrite() to use the new mechanism instead of dirtying the
  pages underlying the buffer.

* This allows the normal page and buffer flushing mechanism to operate
  even in situations where the VM page is also the nominal backing store
  for the data (as in tmpfs).

* Will be used by tmpfs.

6 years agokernel - Improve pageout daemon & memory pressure detection w/tmpfs
Matthew Dillon [Wed, 1 Feb 2012 04:52:46 +0000 (20:52 -0800)]
kernel - Improve pageout daemon & memory pressure detection w/tmpfs

* PG_NEED_COMMIT pages are unwired from the buffer cache they are now
  unconditionally placed on the active queue, even if 'activate' is not

* This results in non-freeable tmpfs pages remaining in the active queue
  most of the time.  They will be cycled into the inactive queue and flushed
  out if swap is present as per normal pageout daemon operation,

  When swap is not present or is full, these pages are reactivated

6 years agokernel - Fix incorrect assertion during udp auto-binding
Matthew Dillon [Tue, 31 Jan 2012 22:18:36 +0000 (14:18 -0800)]
kernel - Fix incorrect assertion during udp auto-binding

* When sendto() is used and the UDP socket is not bound the binding
  operation is done by the netisr thread and causes an assertion due
  to not being a process.

* The assertion is incorrect, remove it.  This only occured when lport has
  not been assigned and the cred check is only needed when it has.

Reported-by: Pierre Abbat
6 years agokern - Skip rlimit check when caller is a kernel thread.
Antonio Huete Jimenez [Mon, 30 Jan 2012 13:29:56 +0000 (14:29 +0100)]
kern - Skip rlimit check when caller is a kernel thread.

Pointed-out-by: vsrinivas
6 years agokernel -- linprocfs: linprocfs_allocvp should return a locked vnode.
Venkatesh Srinivas [Sun, 5 Feb 2012 15:04:57 +0000 (10:04 -0500)]
kernel -- linprocfs: linprocfs_allocvp should return a locked vnode.

Fixes a panic where VFS_ROOT returned an unlocked vnode and led to
a lockmgr panic from vput in the namecache.

Reported-by: phma
Bug: 2298

6 years agosh: Test EXIT trap with multiple statements in it
Peter Avalos [Sun, 5 Feb 2012 20:43:12 +0000 (12:43 -0800)]
sh: Test EXIT trap with multiple statements in it

Obtained-from:  FreeBSD 230211
(cherry picked from commit 9ad23e0abe8de4dd2c554c0c21ff7bcce910d66b)

6 years agosh: Add testcases that should not be broken by future optimizations.
Peter Avalos [Sun, 5 Feb 2012 20:38:57 +0000 (12:38 -0800)]
sh: Add testcases that should not be broken by future optimizations.

Obtained-from:  FreeBSD 230121
(cherry picked from commit 0ca7d8dd5520d00c3d26305fe17ef73651d93cca)

6 years agosh: Avoid possible echo options in a testcase.
Peter Avalos [Sun, 5 Feb 2012 20:36:00 +0000 (12:36 -0800)]
sh: Avoid possible echo options in a testcase.

Obtained-from:  FreeBSD 229742
(cherry picked from commit 2fdf52317ffd855dbe1690c83bc3d83718a0f992)

6 years agosh: Fix swapped INTON/INTOFF.
Peter Avalos [Sun, 5 Feb 2012 20:26:01 +0000 (12:26 -0800)]
sh: Fix swapped INTON/INTOFF.

A possible consequence of this bug was a memory leak if SIGINT arrived
during a 'set' command (listing variables).

Obtained-from:  FreeBSD 231001
(cherry picked from commit 97e1125af7205a348d9c853f7f73b42dd4a76d26)

6 years agosh: Use vfork in a few common cases.
Peter Avalos [Sun, 5 Feb 2012 20:21:25 +0000 (12:21 -0800)]
sh: Use vfork in a few common cases.

This uses vfork() for simple commands and command substitutions containing a
single simple command, invoking an external program under certain conditions
(no redirections or variable assignments, non-interactive shell, no job
control). These restrictions limit the amount of code executed in a vforked

There is a large speedup (for example 35%) in microbenchmarks. The
difference in buildkernel is smaller (for example 0.5%) but still
statistically significant. See
for some numbers.

The use of vfork() can be disabled by setting a variable named

Obtained-from:  FreeBSD 230998
(cherry picked from commit 3fb5edd5046fcd04f359351f47e70ad37816977a)

6 years agosh: Fix $? in the first command of a 'for'.
Peter Avalos [Sun, 5 Feb 2012 20:12:44 +0000 (12:12 -0800)]
sh: Fix $? in the first command of a 'for'.

In the first command of a 'for', $? should be the exit status of the last
pipeline (command substitution in the word list or command before 'for'),
not always 0.

Obtained-from:  FreeBSD 230463
(cherry picked from commit 723ecb596978d3ed4d37a449ce636a35c743ec80)

6 years agosh: Remove "kill" example function, which is superseded by the kill
Peter Avalos [Sun, 5 Feb 2012 20:10:27 +0000 (12:10 -0800)]
sh: Remove "kill" example function, which is superseded by the kill

Obtained-from:  FreeBSD 230437
(cherry picked from commit 123973d7ccb9bf681d124de73d64c3d7eb73e7fa)

6 years agosh: Fix execution of multiple statements in a trap when evalskip is set
Peter Avalos [Sun, 5 Feb 2012 20:07:56 +0000 (12:07 -0800)]
sh: Fix execution of multiple statements in a trap when evalskip is set

Before this fix, only the first statement of the trap was executed if
evalskip was set. This is for example the case when:
    o  "-e" is set for this shell
    o  a trap is set on EXIT
    o  a function returns 1 and causes the script to abort

Obtained-from:  FreeBSD 230212
(cherry picked from commit a1cf61ab1fd76b3e90e17fc4bc03767015deb2e1)

6 years agosh: Fix some bugs with exit status from case containing ;&.
Peter Avalos [Sun, 5 Feb 2012 20:04:53 +0000 (12:04 -0800)]
sh: Fix some bugs with exit status from case containing ;&.

Also, rework evalcase() to not evaluate any tree. Instead, return the
NCLISTFALLTHRU node and handle it in evaltree().

Fixed bugs:

* If a ;& list with non-zero exit status is followed by an empty ;; or final
  list, the exit status of the case command should be equal to the exit
  status of the ;& list, not 0.

* An empty ;& case should not reset $?.

Obtained-from:  FreeBSD 230161
(cherry picked from commit b88d2fafe2e2a6d776e70cb6d6cca1533087b699)

6 years agosh: Fix two bugs with case and exit status:
Peter Avalos [Sun, 5 Feb 2012 20:02:44 +0000 (12:02 -0800)]
sh: Fix two bugs with case and exit status:

* If no pattern is matched, POSIX says the exit status shall be 0 (even if
  there are command substitutions).
* If a pattern is matched and there are no command substitutions, the first
  command should see the $? from before the case command, not always 0.

Obtained-from:  FreeBSD 230154
(cherry picked from commit c79cd3b3a40bbcea12f869fee83c021fc6c8bf90)

6 years agosh: Change input buffer size from 1023 to 1024.
Peter Avalos [Sun, 5 Feb 2012 20:00:29 +0000 (12:00 -0800)]
sh: Change input buffer size from 1023 to 1024.

Apparently this improves performance on slower platforms.

Obtained-from:  FreeBSD 230118
(cherry picked from commit 43cdc26c9fc6fb1e385f2d3238bcb96c3e5ea221)

6 years agosh: Fix out of bounds array access when trap is used with an invalid
Peter Avalos [Sun, 5 Feb 2012 19:52:44 +0000 (11:52 -0800)]
sh: Fix out of bounds array access when trap is used with an invalid

Obtained-from:  FreeBSD 230117
(cherry picked from commit 5748538799e46b68d37b9a51172a8c47607ebdb4)

6 years agosh: Properly show "Not a directory" error in cd builtin.
Peter Avalos [Sun, 5 Feb 2012 19:44:29 +0000 (11:44 -0800)]
sh: Properly show "Not a directory" error in cd builtin.

The errno message display added in 72cbf4010 did not take attempting to
cd to a non-directory or something that cannot be stat()ed into account.

Obtained-from:  FreeBSD 230095
(cherry picked from commit 2b271b9bd2c4b4c7b94e1d246aebde69a6e37819)

6 years agosh: Make various functions static.
Peter Avalos [Sun, 5 Feb 2012 19:42:22 +0000 (11:42 -0800)]
sh: Make various functions static.

Obtained-from:  FreeBSD 229220
(cherry picked from commit b6bd99f63ba9b8eeb9dcfd0f5b11ea363199cd9a)

6 years agosh: Remove unused function scopyn().
Peter Avalos [Sun, 5 Feb 2012 19:30:56 +0000 (11:30 -0800)]
sh: Remove unused function scopyn().

Obtained-from: FreeBSD 229219
(cherry picked from commit 632067f1fe927fb0869e88c9a9711d90f0e7dd60)

6 years agosh: Make patmatch() non-recursive.
Peter Avalos [Sun, 5 Feb 2012 19:28:08 +0000 (11:28 -0800)]
sh: Make patmatch() non-recursive.

Obtained-from:  FreeBSD 229201
(cherry picked from commit ea8fa3ef2fcd3c09935f42b16a7afaae189eec5d)

6 years agosh: Allow quoting ^ and ] in bracket expressions.
Peter Avalos [Sun, 5 Feb 2012 19:23:10 +0000 (11:23 -0800)]
sh: Allow quoting ^ and ] in bracket expressions.

Obtained-from:  FreeBSD 228943
(cherry picked from commit 4353aa4e29e275869dd6e6c5af76ad724bc2e213)

6 years agosh: Use dirent.d_type in pathname generation.
Peter Avalos [Sun, 5 Feb 2012 19:20:09 +0000 (11:20 -0800)]
sh: Use dirent.d_type in pathname generation.

This improves performance for globs where a slash or another component
follows a component with metacharacters by eliminating unnecessary
attempts to open directories that are not.

Obtained-from:  FreeBSD 228942
(cherry picked from commit c601174268e0ea6cad93a733cecb3a07b2c503a6)

6 years agosh: Cache de->d_namlen in a local variable.
Peter Avalos [Sun, 5 Feb 2012 19:16:08 +0000 (11:16 -0800)]
sh: Cache de->d_namlen in a local variable.

Obtained-from:  FreeBSD 228941
(cherry picked from commit 867f2c406941a0de5691b6e550dbaea0262a3429)

6 years agosh: Don't force special builtins non-special in optimized command subst.
Peter Avalos [Sun, 5 Feb 2012 19:11:06 +0000 (11:11 -0800)]
sh: Don't force special builtins non-special in optimized command subst.

This is not necessary: errors are already caught in evalbackcmd() and
forcelocal handles changes to variables.

Obtained-from:  FreeBSD 228937
(cherry picked from commit d303b442299ef4e2fd081023559b4a89656d1ebf)

6 years agoSupport exception handling on statically-linked binaries
John Marino [Sun, 5 Feb 2012 16:21:27 +0000 (17:21 +0100)]
Support exception handling on statically-linked binaries

The real-time dynamic linker handles exceptions on dynamically-linked
binaries through the dl_iterate_phdr function.  The RTLD isn't invoked
on statically-built executables so thrown exceptions weren't getting
handled.  There was a dummy dl_iterate_phdr function in libc with a
weak symbol that gets looked at when the rtld version isn't present.
This function was populated and gets called when the statically-linked
executable throws an exception.

It requires the GNU_EH_FRAME program header to be present.  The base
gcc 4.4 spec file was modified to emit this header for statically-built
binaries in addition to the dynamically lined ones.

6 years agocdefs: Rework and augment visibility attributes
John Marino [Sun, 5 Feb 2012 16:14:25 +0000 (17:14 +0100)]
cdefs: Rework and augment visibility attributes

One macro based on GCC visibility functions was already defined,
__exported.  However, it was marked as available for all GCC versions
when it fact it was introduced with gcc 4.0.

There was no macro for hidden visibility attributes, so the macros
__dso_hidden and __dso_public were borrowed from NetBSD.  __dso_public
is an alias for __exported.  The definition for all three macros were
made on the condition that the gcc version used is 4.0 or later.

6 years agovkernel - Fix semi-random SIGILL crashes under heavy network loads
Matthew Dillon [Thu, 2 Feb 2012 23:17:44 +0000 (15:17 -0800)]
vkernel - Fix semi-random SIGILL crashes under heavy network loads

* SIGIO was being installed with SA_NODEFER, resulting in situations
  under heavy network loads where multiple SIGIOs could stack and cause
  a stack overflow.  This often resulted in the sendsig code in the kernel
  generating a SIGILL to the process after being unable to push a new
  signal context.

* Removing SA_NODEFER appears to solve the problem.

Reported-by: tuxillo
6 years agokernel - Fix lockmgr lock mismatch panics when iwn used without wlan
Matthew Dillon [Thu, 2 Feb 2012 03:43:26 +0000 (19:43 -0800)]
kernel - Fix lockmgr lock mismatch panics when iwn used without wlan

* If if_iwn is ifconfig'd without going through wlan the wlan_serializer
  is not held during the firmware load stage, resulting in a panic.
  Acquire the serializer for this case.

* Note: iwn worked fine with wlan, but this fixes an annoying panic when
  people try to mess with it without wlan.

Reported-by: fxr (irc)
6 years agokernel - Add missing DRM_LOCK()
Matthew Dillon [Wed, 1 Feb 2012 21:40:19 +0000 (13:40 -0800)]
kernel - Add missing DRM_LOCK()

* Add missing DRM_LOCK() in the i915 X11 ioctl path

Reported-by: Pierre Abbat
Dump-by: Magliano Andrea
6 years agocrypto.ko: Add a missing file.
Sascha Wildner [Tue, 31 Jan 2012 10:17:27 +0000 (11:17 +0100)]
crypto.ko: Add a missing file.

Submitted-by: CosmicDJ
6 years agolibc: correct copyright notice in makecontext.c
Markus Pfeiffer [Fri, 27 Jan 2012 21:59:06 +0000 (21:59 +0000)]
libc: correct copyright notice in makecontext.c

6 years agoMerge branch 'DragonFly_RELEASE_3_0' of ssh://crater.dragonflybsd.org/repository...
Venkatesh Srinivas [Mon, 30 Jan 2012 12:15:03 +0000 (04:15 -0800)]
Merge branch 'DragonFly_RELEASE_3_0' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into rel3_0

6 years agokernel -- nata: Use ATA_DEFAULT_TIMEOUT (10) rather than 1 for ATA controlcmds.
Venkatesh Srinivas [Fri, 27 Jan 2012 10:55:15 +0000 (02:55 -0800)]
kernel -- nata: Use ATA_DEFAULT_TIMEOUT (10) rather than 1 for ATA controlcmds.

A one-second timeout for control commands was inappropriate for
among others.

6 years agokernel: Add some missing headers to the Makefiles of cryptodev and tun.
Sascha Wildner [Sun, 29 Jan 2012 21:39:58 +0000 (22:39 +0100)]
kernel: Add some missing headers to the Makefiles of cryptodev and tun.

Reported-by: CosmicDJ on #dragonflybsd
6 years agotexinfo: Add /usr/pkg/info to the list of directories searched by info(1).
Sascha Wildner [Sun, 29 Jan 2012 21:15:31 +0000 (22:15 +0100)]
texinfo: Add /usr/pkg/info to the list of directories searched by info(1).

6 years agokernel - properly initialize vnode->v_pfsmp
Francois Tigeot [Sun, 29 Jan 2012 08:42:38 +0000 (09:42 +0100)]
kernel - properly initialize vnode->v_pfsmp

* add and rewrite comments to document it better

6 years agoRevert "sys/config: Readd COMPAT_43 to i386 kernels: COMPAT_LINUX needs it"
Thomas Nikolajsen [Sat, 28 Jan 2012 01:04:27 +0000 (02:04 +0100)]
Revert "sys/config: Readd COMPAT_43 to i386 kernels: COMPAT_LINUX needs it"

This reverts commit dbcbcaa29ebe161b19b6cec288c1a8559aebc0a0.

6 years agoCOMPAT_LINUX: Remove need for COMPAT_43
Thomas Nikolajsen [Sat, 28 Jan 2012 00:59:37 +0000 (01:59 +0100)]
COMPAT_LINUX: Remove need for COMPAT_43

Implement linux_sethostname and linux_ostat natively to
stop using implementation from COMPAT_43.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2289>
Submitted-by: Samuel J. Greear and Matt Dillon
6 years agoMerge commit 'crater/DragonFly_RELEASE_3_0' into rel3_0
Thomas Nikolajsen [Thu, 26 Jan 2012 23:11:49 +0000 (00:11 +0100)]
Merge commit 'crater/DragonFly_RELEASE_3_0' into rel3_0

6 years agosys/config: Readd COMPAT_DF12 to i386 kernels, to run FreeBSD 4 binaries
Thomas Nikolajsen [Thu, 26 Jan 2012 22:58:05 +0000 (23:58 +0100)]
sys/config: Readd COMPAT_DF12 to i386 kernels, to run FreeBSD 4 binaries

Commit ce6b2144 made this change to GENERIC,
do the same for the other i386 kernels.

6 years agosys/config: Readd COMPAT_43 to i386 kernels: COMPAT_LINUX needs it
Thomas Nikolajsen [Thu, 26 Jan 2012 22:52:53 +0000 (23:52 +0100)]
sys/config: Readd COMPAT_43 to i386 kernels: COMPAT_LINUX needs it
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2289>

6 years agolibc: add getcontext, setcontext, makecontext and swapcontext on x86_64
Markus Pfeiffer [Wed, 25 Jan 2012 13:11:23 +0000 (13:11 +0000)]
libc: add getcontext, setcontext, makecontext and swapcontext on x86_64

The *context functions are not part of the POSIX standard anymore, but
are still used by quite some packages.

6 years agodrm - Add PCI ID for Radeon HD 4250 (AMD 880 onboard video)
Samuel J. Greear [Thu, 26 Jan 2012 04:39:34 +0000 (21:39 -0700)]
drm - Add PCI ID for Radeon HD 4250 (AMD 880 onboard video)

6 years agoSwitch the 3.0-RELEASE branch back to using binutils-2.21.
Sascha Wildner [Wed, 25 Jan 2012 19:39:59 +0000 (20:39 +0100)]
Switch the 3.0-RELEASE branch back to using binutils-2.21.

There are still 2.22 specific issues in pkgsrc and we want to be on
the safe side for the release.

Requested-by: marino
6 years agoRevert "nataraid(4): Add devstat support."
Sascha Wildner [Wed, 25 Jan 2012 08:05:46 +0000 (09:05 +0100)]
Revert "nataraid(4): Add devstat support."

This reverts commit 3e184884618d66845f8b90e6dae483155da6dce6.

Oops, it was a bit too untested and causes nasty messages on the
console. Will investigate and commit a proper fix.

Reported-by: Joerg Anslik <joerg@anslik.de>
6 years agokernel - Fix SILI callout timer race
Matthew Dillon [Mon, 23 Jan 2012 20:55:33 +0000 (12:55 -0800)]
kernel - Fix SILI callout timer race

* Do similar fix for SILI that we did for AHCI.

* callout_stop_sync() can block.  If this occurs a race can cause a
  CCB to be processed for completion twice.

* Add a serial number to detect this situation.

* If the serial number does not match after the timeout is stopped
   we don't want to mess with the xa at all.

Tested-by: lentferj
6 years agokernel/firewire: Move a dereference behind the NULL check.
Sascha Wildner [Mon, 23 Jan 2012 00:55:44 +0000 (01:55 +0100)]
kernel/firewire: Move a dereference behind the NULL check.

6 years agoRaise default .Os value for the manual pages to 3.0 on the release branch.
Sascha Wildner [Sun, 22 Jan 2012 22:45:04 +0000 (23:45 +0100)]
Raise default .Os value for the manual pages to 3.0 on the release branch.

6 years agoSwitch to pkgsrc-2011Q4.
Justin C. Sherrill [Sun, 22 Jan 2012 22:35:37 +0000 (17:35 -0500)]
Switch to pkgsrc-2011Q4.

6 years agoRelease 3.0 branch. v3.0.0
Justin C. Sherrill [Sun, 22 Jan 2012 21:05:08 +0000 (13:05 -0800)]
Release 3.0 branch.

6 years agocrontab(1): Adjust the number of comment lines in front of the tab.
Sascha Wildner [Sun, 22 Jan 2012 20:26:41 +0000 (21:26 +0100)]
crontab(1): Adjust the number of comment lines in front of the tab.

In 229cb57b2cbab37a8a0cc1499cebf7e9c9e1deec I removed the third line
of comment that crontab(1) puts in front of the tab file (which was
the CVS ID of crontab.c), but I forgot to adjust the #define saying
how much lines to skip.

This led to the first line of comment written by the user not being
visible in crontab -e.

Reported-by: lentferj
6 years agofwcontrol(8): Remove an unused variable and raise WARNS to 2.
Sascha Wildner [Sun, 22 Jan 2012 19:35:23 +0000 (20:35 +0100)]
fwcontrol(8): Remove an unused variable and raise WARNS to 2.

6 years agokernel/acpi: Fix a reference to an uninitialized ptr.
Sascha Wildner [Sun, 22 Jan 2012 12:29:29 +0000 (13:29 +0100)]
kernel/acpi: Fix a reference to an uninitialized ptr.

6 years agosendfile: Block or return EAGAIN, iff we are really short of space
Sepherosa Ziehau [Sun, 22 Jan 2012 13:59:30 +0000 (21:59 +0800)]
sendfile: Block or return EAGAIN, iff we are really short of space

Send sockbuf's lowat could be quite "high" (hiwat/2), the originally
code actually only uses 1/2 of the send sockbuf space, thus poor

6 years agosockbuf: Pre-alloc sockbuf space, so asynchronized pru_send could be used.
Sepherosa Ziehau [Sun, 22 Jan 2012 13:29:29 +0000 (21:29 +0800)]
sockbuf: Pre-alloc sockbuf space, so asynchronized pru_send could be used.

When doing asynchronized pru_send, it is quite possible that we could
break the send sockbuf's upper limit, if we only use ssb_space() to
calculate the remaining sockbuf space.

Now, we add another two counters into sockbuf, when we send a mbuf
chain to the netisr, we update the these two counters to reflect how
much mbufs will be pending on the send sockbuf.  When calculating the
remaining space of the send sockbuf we also take these two counters
into consideration, so we will not break the upper limit of the send
sockbuf.  These two counter will also be updated when the mbufs in
the sockbuf is to be dropped/freed.

Reenable the asynchronized pru_send in sendfile and sosendtcp

6 years agopru_send: Disable asynchornized pru_send usage by default
Sepherosa Ziehau [Sun, 22 Jan 2012 09:36:07 +0000 (17:36 +0800)]
pru_send: Disable asynchornized pru_send usage by default

It may cause problem, e.g. too many mbufs sitting in the TCP send buffer,
when facing with certain attacks, e.g. FIN_WAIT_1 DoS.

Reported-by: pavalos@
6 years agosendfile: Add sysctl to disable the usage of the asynchronized pru_send
Sepherosa Ziehau [Sun, 22 Jan 2012 09:33:08 +0000 (17:33 +0800)]
sendfile: Add sysctl to disable the usage of the asynchronized pru_send

6 years agocarp: BGL -> CARP global token
Sepherosa Ziehau [Sun, 22 Jan 2012 03:54:14 +0000 (11:54 +0800)]
carp: BGL -> CARP global token

6 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Samuel J. Greear [Sat, 21 Jan 2012 21:46:56 +0000 (14:46 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

6 years agorc - Add a default setting for udevd_early, silences warning at boot
Samuel J. Greear [Sat, 21 Jan 2012 21:46:24 +0000 (14:46 -0700)]
rc - Add a default setting for udevd_early, silences warning at boot

6 years agoMerge commit 'crater/master'
Thomas Nikolajsen [Sat, 21 Jan 2012 20:27:27 +0000 (21:27 +0100)]
Merge commit 'crater/master'

6 years agoetc/auth.conf: Add sha512/sha256/blf
Thomas Nikolajsen [Sat, 21 Jan 2012 18:54:12 +0000 (19:54 +0100)]
etc/auth.conf: Add sha512/sha256/blf

6 years agologin.conf.5: Add sha256/sha512
Thomas Nikolajsen [Sat, 21 Jan 2012 18:51:03 +0000 (19:51 +0100)]
login.conf.5: Add sha256/sha512

6 years agopam_unix.c: Change default hash
Thomas Nikolajsen [Sat, 21 Jan 2012 18:26:10 +0000 (19:26 +0100)]
pam_unix.c: Change default hash

Change to sha512; same as in etc/login.conf.

6 years agologin.conf.5: Fix mdoc problems
Thomas Nikolajsen [Sat, 21 Jan 2012 17:57:10 +0000 (18:57 +0100)]
login.conf.5: Fix mdoc problems

Fix problems identified by mandoc(1).

To get both groff(1) and mandoc(1) to format nice
headlines changed from TAB changed to Ta use.
This seems like a groff(1) bug.

6 years agocrypt.3: Update algorithm numbers ($N$)
Thomas Nikolajsen [Sat, 21 Jan 2012 17:43:40 +0000 (18:43 +0100)]
crypt.3: Update algorithm numbers ($N$)

Fix algorithm number for Blowfish, SHA256 and SHA512,
note that existing SHA256 and SHA512 implementations
are deprecated and add new implementations.

While here add missing line breaks at end of sentence.

6 years agoFix buildkernel -j N
Thomas Nikolajsen [Sat, 21 Jan 2012 17:10:32 +0000 (18:10 +0100)]
Fix buildkernel -j N

Work around build ordering issue which caused
`make -j N buildkernel' to fail on some systems.

DragonFly-bug: <http://bugs.dragonflybsd.org/issue2279>
Submitted-by: YONETANI Tomokazu
6 years agonataraid(4): Add devstat support.
Sascha Wildner [Sat, 21 Jan 2012 16:34:46 +0000 (17:34 +0100)]
nataraid(4): Add devstat support.

6 years agoinstaller: Warn <10GB HAMMER filesystems are unsupported
Francois Tigeot [Sat, 21 Jan 2012 12:04:31 +0000 (13:04 +0100)]
installer: Warn <10GB HAMMER filesystems are unsupported

7 years agoAdd a copyright notice to cpputil.h
Aggelos Economopoulos [Fri, 20 Jan 2012 23:13:24 +0000 (00:13 +0100)]
Add a copyright notice to cpputil.h

Claim copyright inasmuch as there is any to claim for this trivial file.

Reminded-by: swildner@
7 years agokernel: Remove some more old major number related stuff.
Sascha Wildner [Fri, 20 Jan 2012 22:27:01 +0000 (23:27 +0100)]
kernel: Remove some more old major number related stuff.

7 years agocrypt(3) - Forgotten string in last commit
Samuel J. Greear [Fri, 20 Jan 2012 20:12:55 +0000 (13:12 -0700)]
crypt(3) - Forgotten string in last commit

7 years agocrypt(3) - Paper over sizeof()/strlen() bug causing 32/64-bit issues
Samuel J. Greear [Fri, 20 Jan 2012 20:04:56 +0000 (13:04 -0700)]
crypt(3) - Paper over sizeof()/strlen() bug causing 32/64-bit issues

* In one place sizeof() was used instead of strlen(), causing the password
  to be muxed with 4 bytes of random stack data on 64-bit machines. Codify
  this behavior for reverse compatibility.

7 years agokernel - Fix AHCI callout timer race (2)
Matthew Dillon [Fri, 20 Jan 2012 19:23:54 +0000 (11:23 -0800)]
kernel - Fix AHCI callout timer race (2)

* Fix minor bug in last commit.  If the serial number does not match
  after the timeout is stopped we don't want to mess with the xa at

7 years agokernel - Fix race in callout_stop_sync()
Matthew Dillon [Fri, 20 Jan 2012 18:23:06 +0000 (10:23 -0800)]
kernel - Fix race in callout_stop_sync()

* When callout_stop_sync() races a timeout callback which re-arms the
  callout it can hit an assertion.  The assertion is incorrect.  Instead
  of asserting we have to loop up and try again.

7 years agokernel - Fix AHCI callout timer race
Matthew Dillon [Fri, 20 Jan 2012 18:20:20 +0000 (10:20 -0800)]
kernel - Fix AHCI callout timer race

* callout_stop_sync() can block.  If this occurs a race can cause a
  CCB to be processed for completion twice.

* Add a serial number to detect this situation.

Reported-by: "G. Isenmann via Redmine"
7 years agokernel - Fix pmap_release() bug for i386
Matthew Dillon [Fri, 20 Jan 2012 17:56:51 +0000 (09:56 -0800)]
kernel - Fix pmap_release() bug for i386

* Fix 'pmap_release: page should already be gone' panic

* There is a race condition which can result in the case.  Release the
  page normally instead of panicing.

Reported-by: tuxillo
7 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Samuel J. Greear [Fri, 20 Jan 2012 13:16:44 +0000 (06:16 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

7 years agocrypt(3) - Switch SHA256/512 to the Linux implementation
Samuel J. Greear [Fri, 20 Jan 2012 12:24:33 +0000 (05:24 -0700)]
crypt(3) - Switch SHA256/512 to the Linux implementation

* The existing SHA backends have been shown to be more susceptible to brute-
  force attacks than we would prefer --

* Bring in the reference implementation used in Linux, code is in the public

* Add required (standard) functions mempcpy and stpcpy.

* Change default for future installs to SHA512, this is the default on at
  least archlinux and fedora.

* Add some minor hacks to libcrypt/crypt.c to ensure that
  a) All existing passwords continue to work
  b) All future passwords will be more secure with no changes required

* To update passwords to the new format use passwd(1) for each user, and to
  change your default password type to SHA512 (default for new installations)
  change the passwd_format setting under default to "sha512".

7 years agoicu_abi/x86_64: {msi,msix}_release returns nothing
Sepherosa Ziehau [Fri, 20 Jan 2012 06:37:59 +0000 (14:37 +0800)]
icu_abi/x86_64: {msi,msix}_release returns nothing

7 years agoi386: Implement MSI-X allocation and release support
Sepherosa Ziehau [Fri, 20 Jan 2012 06:35:34 +0000 (14:35 +0800)]
i386: Implement MSI-X allocation and release support

7 years agoicu/x86_64: Implement MSI-X alloc/release
Sepherosa Ziehau [Fri, 20 Jan 2012 05:09:05 +0000 (13:09 +0800)]
icu/x86_64: Implement MSI-X alloc/release

7 years agokernel: Remove two more major numbers.
Sascha Wildner [Fri, 20 Jan 2012 04:28:10 +0000 (05:28 +0100)]
kernel: Remove two more major numbers.

7 years agokernel: Remove some old major numbers.
Sascha Wildner [Fri, 20 Jan 2012 04:15:50 +0000 (05:15 +0100)]
kernel: Remove some old major numbers.

7 years agoLINT/LINT64: Add snd_gusc.
Sascha Wildner [Fri, 20 Jan 2012 03:58:59 +0000 (04:58 +0100)]
LINT/LINT64: Add snd_gusc.