dragonfly.git
4 years agoImport vm_map_findspace(9) manpage from FreeBSD and add flags/align arguments.
Venkatesh Srinivas [Wed, 8 Dec 2010 06:37:25 +0000 (22:37 -0800)]
Import vm_map_findspace(9) manpage from FreeBSD and add flags/align arguments.

4 years agoKernel configs: Move twa(4) to the right place, too.
Sascha Wildner [Wed, 8 Dec 2010 02:38:38 +0000 (03:38 +0100)]
Kernel configs: Move twa(4) to the right place, too.

4 years agoClean up and sort the RAID sections in our configs.
Sascha Wildner [Wed, 8 Dec 2010 02:35:57 +0000 (03:35 +0100)]
Clean up and sort the RAID sections in our configs.

4 years agokernel: Serial numbers have to be either 2 chars minimum or not be a blank.
Sascha Wildner [Wed, 8 Dec 2010 00:50:07 +0000 (01:50 +0100)]
kernel: Serial numbers have to be either 2 chars minimum or not be a blank.

The hptiop(4) controller's logical disks have a " " (single space)
serial number, which caused /dev/serno/_ to be created.

4 years agohptiop(4): Fix device description.
Sascha Wildner [Wed, 8 Dec 2010 00:28:05 +0000 (01:28 +0100)]
hptiop(4): Fix device description.

4 years agohptiop(4): Add the hptiop(4) RAID driver.
Sascha Wildner [Tue, 7 Dec 2010 23:54:45 +0000 (00:54 +0100)]
hptiop(4): Add the hptiop(4) RAID driver.

The driver supports the following adapters:

* HighPoint RocketRAID 3020
* HighPoint RocketRAID 3120
* HighPoint RocketRAID 3122
* HighPoint RocketRAID 3220
* HighPoint RocketRAID 3320
* HighPoint RocketRAID 3410
* HighPoint RocketRAID 3510
* HighPoint RocketRAID 3511
* HighPoint RocketRAID 3520
* HighPoint RocketRAID 3521
* HighPoint RocketRAID 3522
* HighPoint RocketRAID 3540
* HighPoint RocketRAID 4320

It was tested with the 3120.

Many thanks to FreeBSD, from which this code was obtained.

4 years agoperiodic/security: fix warnings on a system with no packages installed
YONETANI Tomokazu [Tue, 7 Dec 2010 01:46:06 +0000 (10:46 +0900)]
periodic/security: fix warnings on a system with no packages installed

4 years agodevattr - a tool to expose the libdevattr functionality
Nolan Lum [Tue, 7 Dec 2010 06:03:30 +0000 (06:03 +0000)]
devattr - a tool to expose the libdevattr functionality

4 years agokernel - Enable e1000 / igb netif in module build
Matthew Dillon [Tue, 7 Dec 2010 03:27:46 +0000 (19:27 -0800)]
kernel - Enable e1000 / igb netif in module build

* Add if_igb to the module build, via e1000.

4 years agokernel - 64-bit memory & ncpus work
Matthew Dillon [Tue, 7 Dec 2010 03:24:30 +0000 (19:24 -0800)]
kernel - 64-bit memory & ncpus work

* Create a macro and bsr function for cpu masks in preparation for
  making cpumask_t 64 bits on 64-bit builds.  cpumask_t is still
  32 bits in this commit.

* Expand SMP_MAXCPUS to 31 for 64-bit builds in preparation for
  eventually expanding it to 63.

* Fix an array overflow when probing ncpus on 64-bit.

* Increase the boot-time kmap entries to accomodate large numbers of
  cpus.

* Clean up a few places where integer overflows could occur on
  64-bit machines with large amounts of ram.

  For the moment we are limited to 32G.  This will change in a
  followup commit.

4 years agokernel - Fix lapic mask for > 16 apic ids
Matthew Dillon [Mon, 6 Dec 2010 22:03:42 +0000 (14:03 -0800)]
kernel - Fix lapic mask for > 16 apic ids

* The lapic mask in the MP startup was only allowing for 16 apic ids,
  adjust the mask to allow for all 256.

* Supermicro now boots w/12 cpus and probably 24.  More work required
  to get it to boot w/48.

4 years agoamr(4): Return the correct error.
Sascha Wildner [Mon, 6 Dec 2010 20:21:53 +0000 (21:21 +0100)]
amr(4): Return the correct error.

error was not being set for two functions, and if these failed, 0 was
incorrectly returned.

4 years agoaac(4) & mfi(4): Fix masking bug.
Sascha Wildner [Mon, 6 Dec 2010 18:12:30 +0000 (19:12 +0100)]
aac(4) & mfi(4): Fix masking bug.

When masking direct and processor devices during an inquiry, properly
preserve the upper bits of the first data byte.

Taken-from: FreeBSD

4 years agomfi(4): Shorten some lines.
Sascha Wildner [Mon, 6 Dec 2010 17:57:55 +0000 (18:57 +0100)]
mfi(4): Shorten some lines.

Taken-from: FreeBSD

4 years agokernel - Provide descriptions for many net.inet sysctl's
Samuel J. Greear [Sun, 5 Dec 2010 05:09:15 +0000 (05:09 +0000)]
kernel - Provide descriptions for many net.inet sysctl's

* Switch net.inet.ip.dispatch_* to RD from RW

Submitted-by: Taras Klaskovsky
Sponsored-by: Google Code-In
4 years agokernel - mlockall: Return EINVAL for invalid flags combinations.
Venkatesh Srinivas [Sun, 5 Dec 2010 04:40:22 +0000 (20:40 -0800)]
kernel - mlockall: Return EINVAL for invalid flags combinations.

Reported by: swildner

4 years agoAdd a missing file for building libiconv into the kernel.
Sascha Wildner [Sun, 5 Dec 2010 04:01:00 +0000 (05:01 +0100)]
Add a missing file for building libiconv into the kernel.

4 years agoMake more things (HPFS, *_ICONV) buildable into the kernel.
Sascha Wildner [Sun, 5 Dec 2010 03:43:36 +0000 (04:43 +0100)]
Make more things (HPFS, *_ICONV) buildable into the kernel.

4 years agotest - Add test case for prior select(2)/EOF bug
Samuel J. Greear [Sun, 5 Dec 2010 03:24:28 +0000 (03:24 +0000)]
test - Add test case for prior select(2)/EOF bug

* This test reproduces the problem fixed in commit:
  57b24f4ee66aaaa59b54e9577b93253cf435672f

Issue: http://bugs.dragonflybsd.org/issue1809
Submitted-by: Johannes Hofmann
4 years agoRegenerate the pciconf(8) database
Sascha Wildner [Sun, 5 Dec 2010 00:05:35 +0000 (01:05 +0100)]
Regenerate the pciconf(8) database

...from the following files:

Hart:    Jan 22, 2008 (version 671)
Boemler: Dec  4, 2010
Mares:   Nov 24, 2010

4 years agoFix a typo and add PMAP_DEBUG to LINT.
Sascha Wildner [Sat, 4 Dec 2010 21:00:49 +0000 (22:00 +0100)]
Fix a typo and add PMAP_DEBUG to LINT.

4 years agokernel - remove extra crit_exit()
YONETANI Tomokazu [Sat, 4 Dec 2010 13:05:42 +0000 (22:05 +0900)]
kernel - remove extra crit_exit()

Those are leftover from 080c00e6fcafedf719b52e5de548a005201b0218 .

4 years agoinstaller: Fix a bug when /boot (HAMMER) or / (UFS) is are to be encrypted.
Sascha Wildner [Sat, 4 Dec 2010 02:20:29 +0000 (03:20 +0100)]
installer: Fix a bug when /boot (HAMMER) or / (UFS) is are to be encrypted.

The installer will warn that this is not possible, but previously left the
encryption flag set. Clear it.

4 years agodocs - Expand the swapcache(8) manual page
Matthew Dillon [Fri, 3 Dec 2010 21:37:32 +0000 (13:37 -0800)]
docs - Expand the swapcache(8) manual page

* Add a description for static and dynamic wear leveling and write-combining

4 years agokernel: Remove some PC98 remains.
Sascha Wildner [Fri, 3 Dec 2010 19:18:23 +0000 (20:18 +0100)]
kernel: Remove some PC98 remains.

These were either not caught when we removed support, or they came back
in later.

4 years agokernel - Remove unneeded critical sections from VM code, add pmap asserts
Matthew Dillon [Fri, 3 Dec 2010 16:48:05 +0000 (08:48 -0800)]
kernel - Remove unneeded critical sections from VM code, add pmap asserts

* Various bits of VM code now only need vm_token and no longer need
  a critical section.

* Add pmap_page_assertzero() assertions in a couple of places when
  PMAP_DEBUG is enabled.

* Add PMAP_DEBUG as a global kernel config option.

* Be a bit more conservative and clear PG_ZERO for all page table
  pages and not just terminal page table pages.  When such pages
  are finally freed they will be zero again due to the way the
  pmap code works but don't make that assumption.

4 years agokernel - Document ordering requirement in lwkt_cpusync_remote2()
Matthew Dillon [Fri, 3 Dec 2010 16:38:01 +0000 (08:38 -0800)]
kernel - Document ordering requirement in lwkt_cpusync_remote2()

* Add a cpu_ccfence() to document necessary ordering but assume
  that the atomic op following handles the actual requirement.

  This is essentially a nop.

4 years agoAdd sha256/512 support to libcrypt, change default
Nolan Lum [Wed, 1 Dec 2010 21:49:53 +0000 (16:49 -0500)]
Add sha256/512 support to libcrypt, change default

* Add sha256 and sha512 support to libcrypt.

* Change the default password hash to sha256.

* All old passwords will of course still works, but all new ones will be
  created using sha256.

Sponsored-by: Google Code-In
4 years agoamr(4): Sync with FreeBSD.
Sascha Wildner [Fri, 3 Dec 2010 13:34:47 +0000 (14:34 +0100)]
amr(4): Sync with FreeBSD.

This adds support for various new devices (full list is in the manual
page), among other things.

Reported-by: Tomaz Borstnar <tomaz.borstnar@over.net>
               Jonas Trollvik <jontro@gmail.com>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue305>

4 years agomfi(4): Add missing dev_ops_remove_minor().
Sascha Wildner [Fri, 3 Dec 2010 13:21:03 +0000 (14:21 +0100)]
mfi(4): Add missing dev_ops_remove_minor().

4 years agokernel - Fix bug in x86-64 version of bzeront()
Matthew Dillon [Fri, 3 Dec 2010 02:11:29 +0000 (18:11 -0800)]
kernel - Fix bug in x86-64 version of bzeront()

* The x86-64 bzeront code was subtracting the wrong value from the count
  when looping.  Note that prior to this commit the code was not being
  used anyway.

* Rearrange the way movnti support is detected and enable for x86-64.

4 years agodm - undo my pointless moving of dm.h
Alex Hornung [Thu, 2 Dec 2010 11:03:11 +0000 (11:03 +0000)]
dm - undo my pointless moving of dm.h

* There was no need to move dm.h, we can just use <dev/disk/dm/dm.h>.

* And since we can do the above, we can also get rid of the strange
  Makefile CFLAGS magic I added.

* Also undo the removal on upgrade of /usr/include/dev/disk/dm/dm.h and
  instead remove sys/dm.h

Reported-by: Sascha Wildner
4 years agoRemove <dev/disk/dm/dm.h> via make upgrade. It's <sys/dm.h> now.
Sascha Wildner [Thu, 2 Dec 2010 11:50:33 +0000 (12:50 +0100)]
Remove <dev/disk/dm/dm.h> via make upgrade. It's <sys/dm.h> now.

4 years agostyle.9: Somehow, half of the usage() example was missing. Fix it.
Sascha Wildner [Thu, 2 Dec 2010 10:06:37 +0000 (11:06 +0100)]
style.9: Somehow, half of the usage() example was missing. Fix it.

Noticed-by: sjg
4 years agokernel - Provide descriptions for many net.inet6 sysctl's
Samuel J. Greear [Thu, 2 Dec 2010 09:34:13 +0000 (09:34 +0000)]
kernel - Provide descriptions for many net.inet6 sysctl's

Submitted-by: Taras Klaskovsky
Sponsored-by: Google Code-In
4 years agomfi(4): Make mfi_linux.ko compile (maybe it even works).
Sascha Wildner [Wed, 1 Dec 2010 21:18:19 +0000 (22:18 +0100)]
mfi(4): Make mfi_linux.ko compile (maybe it even works).

I haven't tested this yet.

4 years agovga/vesa: Use hexdump() instead of cooking our own.
Sascha Wildner [Wed, 1 Dec 2010 19:51:56 +0000 (20:51 +0100)]
vga/vesa: Use hexdump() instead of cooking our own.

4 years agoAdd a hexdump(9) manual page (taken from FreeBSD).
Sascha Wildner [Wed, 1 Dec 2010 19:04:36 +0000 (20:04 +0100)]
Add a hexdump(9) manual page (taken from FreeBSD).

4 years agokernel - Fix mbuf header exhaustion w/ degenerate unix domain socket case
Matthew Dillon [Wed, 1 Dec 2010 17:55:39 +0000 (09:55 -0800)]
kernel - Fix mbuf header exhaustion w/ degenerate unix domain socket case

* Increase the number of mbuf headers to accomodate a degenerate
  fd-passing case with chains of unix domain sockets, one fd per
  socket.

* This does not address other mbuf exhaustion issues which can crop
  up in a user ddos attack due to the default number of fds a user
  is allowed to own.

Reported-by: Venkatesh Srinivas <me@endeavour.zapto.org>
4 years agokernel - Fix deep stack recursion in unix domain socket garbage collection
Matthew Dillon [Wed, 1 Dec 2010 17:53:08 +0000 (09:53 -0800)]
kernel - Fix deep stack recursion in unix domain socket garbage collection

* A chain of unix domain sockets with the previous fd passed into the
  next one can cause a kernel stack overflow.

* Flatten the portion of the gc which would otherwise recurse by placing
  the fp on a list instead of calling a nested closef(), then running
  the closes at the top level.

Reported-by: Venkatesh Srinivas <me@endeavour.zapto.org>
4 years agoinstaller - encrypted root fix for new modules
Alex Hornung [Wed, 1 Dec 2010 15:25:06 +0000 (15:25 +0000)]
installer - encrypted root fix for new modules

* With the new modularized dm, dm_target_crypt will have to be loaded
  explicitly if the module_path is not reachable in the moment the crypt
  target is needed.

* Simply write dm_target_crypt_load="YES" to the installed loader.conf
  so that there are no nasty surprises.

Reported-by: Sascha Wildner
4 years agodm - Modularize it fully
Alex Hornung [Wed, 1 Dec 2010 10:17:55 +0000 (10:17 +0000)]
dm - Modularize it fully

* Move each of the targets (except error and zero) into a subdirectory
  in targets/.

* Change the macro DM_TARGET_MODULE to also let the module depend on dm.

* Add a new macro DM_TARGET_BUILTIN, which must be used instead of
  DM_TARGET_MODULE for targets that are compiled into the main dm.ko
  instead of a separate module. Not doing this will prevent dm.ko from
  unloading.

* Enable automatic loading of target modules if they aren't builtin or
  loaded yet. Automatically loaded modules can be unloaded via kldunload
  safely via a little hack (see source).

* NOTE: automatic loading doesn't always work. /boot must be mounted
  already, so if you are planning on encrypting your swap or similar
  stuff, you need to *EXPLICITLY* load dm_target_crypt.ko via the
  loader.

* NOTE: PLEASE NOTE THE NOTE ABOVE!

* Fix a little issue with dm_target_crypt that would print "unloaded"
  even if it wouldn't unload.

* Change the name of dm_target_stripe to dm_target_striped, since the
  target is actually called "striped".

* Move dm.h to sys/sys/dm.h

* Get rid of files.dm, a leftover from the import

4 years agoUnbreak buildworld.
Sascha Wildner [Wed, 1 Dec 2010 08:29:48 +0000 (09:29 +0100)]
Unbreak buildworld.

4 years agokernel - Replace broken mp lock in bounce pages swi_vm() with spinlock
Matthew Dillon [Wed, 1 Dec 2010 06:01:15 +0000 (22:01 -0800)]
kernel - Replace broken mp lock in bounce pages swi_vm() with spinlock

* Replace old non-MPSAFE crit section and mplock code with a spinlock

* x86-64 was not registering swi_vm(), add that code in.

Reported-by: Venkatesh Srinivas <me@endeavour.zapto.org>
4 years agokernel - Fix NFS race
Matthew Dillon [Wed, 1 Dec 2010 05:59:52 +0000 (21:59 -0800)]
kernel - Fix NFS race

* The nfsnode code could in very rare circumstances double-vput a vnode,
  creating havoc.

4 years agokernel - vm_mmap: Remove Advertising clause and DragonFly CVSID.
Venkatesh Srinivas [Wed, 1 Dec 2010 03:39:50 +0000 (19:39 -0800)]
kernel - vm_mmap: Remove Advertising clause and DragonFly CVSID.

4 years agommcsd(4): Enhance readability by using a variable for the buf pointer.
Sascha Wildner [Wed, 1 Dec 2010 02:44:50 +0000 (03:44 +0100)]
mmcsd(4): Enhance readability by using a variable for the buf pointer.

4 years agohammer.8: Fix typo.
Sascha Wildner [Wed, 1 Dec 2010 01:44:29 +0000 (02:44 +0100)]
hammer.8: Fix typo.

4 years agomfi(4): Add device statistics.
Sascha Wildner [Wed, 1 Dec 2010 01:28:24 +0000 (02:28 +0100)]
mfi(4): Add device statistics.

4 years agocondvar - Constify
Stathis Kamperis [Tue, 30 Nov 2010 16:31:35 +0000 (18:31 +0200)]
condvar - Constify

4 years agomfi(4): Remove the unused MFI_DECODE_LOG option.
Sascha Wildner [Tue, 30 Nov 2010 18:27:34 +0000 (19:27 +0100)]
mfi(4): Remove the unused MFI_DECODE_LOG option.

4 years agomfi(4): Add the mfi(4) RAID driver and the mfiutil(8) configuration tool.
Sascha Wildner [Tue, 30 Nov 2010 16:49:07 +0000 (17:49 +0100)]
mfi(4): Add the mfi(4) RAID driver and the mfiutil(8) configuration tool.

The driver supports the following adapters:

* LSI MegaRAID SAS 1078
* LSI MegaRAID SAS 8408E
* LSI MegaRAID SAS 8480E
* LSI MegaRAID SAS 9260
* Dell PERC5
* Dell PERC6
* IBM ServeRAID M5015 SAS/SATA
* IBM ServeRAID-MR10i
* Intel RAID Controller SROMBSAS18E

It was tested with the LSI MegaRAID SAS 8408E card.

Many thanks to FreeBSD, from which this code was obtained.

4 years agokernel: Bring in hexdump() from FreeBSD.
Sascha Wildner [Mon, 29 Nov 2010 02:38:14 +0000 (03:38 +0100)]
kernel: Bring in hexdump() from FreeBSD.

4 years agomlockall.2: Fix month name and remove trailing whitespace.
Sascha Wildner [Tue, 30 Nov 2010 15:28:23 +0000 (16:28 +0100)]
mlockall.2: Fix month name and remove trailing whitespace.

4 years agoMerge branch 'GCI2010'
Samuel J. Greear [Tue, 30 Nov 2010 05:01:38 +0000 (05:01 +0000)]
Merge branch 'GCI2010'

4 years agokernel - Provide descriptions for lwkt.* and debug.* sysctl's
Samuel J. Greear [Tue, 30 Nov 2010 04:42:32 +0000 (04:42 +0000)]
kernel - Provide descriptions for lwkt.* and debug.* sysctl's

* Take the opportunity to chop a few dead sysctl's as well

Submitted-by: Taras Klaskovsky
Sponsored-by: Google Code-In
4 years agoMerge branch 'master' of git://crater.dragonflybsd.org/dragonfly
Joe Talbott [Tue, 30 Nov 2010 02:11:17 +0000 (21:11 -0500)]
Merge branch 'master' of git://crater.dragonflybsd.org/dragonfly

4 years agounp_connect() - Use euid/egid for access checks via VOP_EACCESS().
Joe Talbott [Tue, 30 Nov 2010 02:03:20 +0000 (21:03 -0500)]
unp_connect() - Use euid/egid for access checks via VOP_EACCESS().

Fixes socket access for set[ug]id applications by using the euid/egid
rather than the uid/gid.

Reported-By: Tim Darby <t+dfbsd@timdarby.net>
4 years agokernel - Run pfil hooks for bridged packets
Matthew Dillon [Mon, 29 Nov 2010 19:38:33 +0000 (11:38 -0800)]
kernel - Run pfil hooks for bridged packets

* The pfil hooks were not being run in all cases for bridged packets.

Submitted-by: Rumko <rumcic@gmail.com>
4 years agokernel - tmpfs - Remove mplock in tmpfs_read().
Venkatesh Srinivas [Mon, 29 Nov 2010 19:23:38 +0000 (11:23 -0800)]
kernel - tmpfs - Remove mplock in tmpfs_read().

4 years agoImport mlockall(2)/munlockall(2) manpage from OpenBSD and modify for Dfly.
Venkatesh Srinivas [Mon, 29 Nov 2010 16:46:27 +0000 (08:46 -0800)]
Import mlockall(2)/munlockall(2) manpage from OpenBSD and modify for Dfly.

4 years agodm - access io_cnt atomically
Alex Hornung [Mon, 29 Nov 2010 08:02:08 +0000 (08:02 +0000)]
dm - access io_cnt atomically

* Now that we are using shared locks at some points, only update the
  io_cnt atomically, otherwise we can mess things up.

4 years agodm - misc minor cleanup
Alex Hornung [Fri, 26 Nov 2010 14:23:12 +0000 (15:23 +0100)]
dm - misc minor cleanup

* remove dead code, weird white spaces and fix comments.

4 years agodm - remove convoluted string comparison methods
Alex Hornung [Fri, 26 Nov 2010 14:08:33 +0000 (15:08 +0100)]
dm - remove convoluted string comparison methods

4 years agodm - minor cleanup
Alex Hornung [Fri, 26 Nov 2010 14:01:33 +0000 (15:01 +0100)]
dm - minor cleanup

* Fix a bit of indenting, add a comment.

* Remove useless and pointless (just as redundant as using both of those
  words) code.

4 years agodm - use shared/exclusive lockmgr for table access
Alex Hornung [Fri, 26 Nov 2010 13:42:12 +0000 (14:42 +0100)]
dm - use shared/exclusive lockmgr for table access

* Use shared/exclusive lockmgr locks for table access instead of this
  random mess of exclusive lockmgr locks, reference counts and condvars.

4 years agodm - properly encapsulate disable_dev
Alex Hornung [Fri, 26 Nov 2010 13:28:38 +0000 (14:28 +0100)]
dm - properly encapsulate disable_dev

4 years agocondvar - add cv_has_waiters()
Alex Hornung [Fri, 26 Nov 2010 13:27:48 +0000 (14:27 +0100)]
condvar - add cv_has_waiters()

4 years agokernel - Document an odd case in vm_page.c
Matthew Dillon [Sun, 28 Nov 2010 06:43:00 +0000 (22:43 -0800)]
kernel - Document an odd case in vm_page.c

* Document cases from the buffer cache where a vm_page's clean/dirty bits
  might be modified without busying the related vm_page.  vm_token is still
  held through the operation.

4 years agoHAMMER VFS - Fix HAMMER_INODE_XDIRTY flags / state assertion
Matthew Dillon [Sun, 28 Nov 2010 06:40:13 +0000 (22:40 -0800)]
HAMMER VFS - Fix HAMMER_INODE_XDIRTY flags / state assertion

* The HAMMER_INODE_XDIRTY flag was not being immediately synchronized
  with the state of ip->rec_tree in one case and the delay could create
  a window of opportunity where an assertion would get hit.

* Remove the window of opportunity, the assertion no longer gets hit.

Reported-by: YONETANI Tomokazu <qhwt.dfly@les.ath.cx>
4 years agokernel - x86-64 - normalize the location of the pcb/md_regs and remove gd_rsp0
Matthew Dillon [Sun, 28 Nov 2010 06:34:56 +0000 (22:34 -0800)]
kernel - x86-64 - normalize the location of the pcb/md_regs and remove gd_rsp0

* Normalize the location of the pcb and related user process register
  frame for traps and system calls.

* The pcb is now 16-byte aligned at the top of the kernel thread's stack
  and md_regs is placed just below it.

* We no longer reserve 16 bytes for a 8086 emulation frame.

* Change the md_regs assignment in the trap code to an assertion that the
  value is correct.

* Remove gd_rsp0, use the value from common_tss.tss_rsp0 instead (which
  is the same).

4 years agokernel - Hold vm_token() for certain buf/bio/vm_page interactions
Matthew Dillon [Sun, 28 Nov 2010 06:28:52 +0000 (22:28 -0800)]
kernel - Hold vm_token() for certain buf/bio/vm_page interactions

* Hold the vm_token when messing around with page valid and dirty bits
  in buffer cache operations.  Such race conditions are possible but would
  be very rare.

* Fix inconsistent use of bio2.bio_offset when swapcache intercepts an
  I/O operation.  When this case occurs the normal filesystem VOP_STRATEGY
  function will not be called and any assumption that bio2.bio_offset
  will represent a block device offset will be invalid.

  To deal with this case swapcache will re-set bio_offset to NOOFFSET.
  Filesystems use this value to determine that no block device offset
  has been cached for a logical file block.

Reported-by: Jan Lentfer <Jan.Lentfer@web.de> (bio_offset issue)
4 years agokernel - Fix MP race in signotify_remote()
Matthew Dillon [Sun, 28 Nov 2010 06:27:10 +0000 (22:27 -0800)]
kernel - Fix MP race in signotify_remote()

* In rare cases it is possible for a process to hop multiple cpus while
  a signal is trying to chase the process.  Adjust signotify_remote() to
  deal with the case.

4 years agokernel - Fix NFS stall and likely also x86-64 seg-fault issue
Matthew Dillon [Sun, 28 Nov 2010 06:20:04 +0000 (22:20 -0800)]
kernel - Fix NFS stall and likely also x86-64 seg-fault issue

* The nfs node hash code was not MPSAFE due to its use of a global
  hash table.  This could lead to a stall condition due to the
  global hash table losing track of its manual lock.  For now use a
  token to interlock hash table access and replace the manual lock
  with a lockmgr lock.

* This appears to have also fixed the long-standing random seg-fault
  issue with x86-64, where a buildworld loop would seg-fault every once
  in a while for no apparent reason.  /usr/src on my test box has always
  been NFS mounted but was never considered a possible contributor to
  the problem.

  If NFS loses track of related nfs nodes or races operations on underlying
  vnodes while expecting their storage to remain stable it is possible
  for a random vnode to become corrupt.  How this could translate to a
  completely random seg-fault is not entirely understood but I surmise
  the unrelated cc1's binary mmap could become corrupt.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk> (nfs issue)
4 years agokernel - Provide descriptions for vm.stats.* sysctl's
Samuel J. Greear [Sun, 28 Nov 2010 02:17:56 +0000 (02:17 +0000)]
kernel - Provide descriptions for vm.stats.* sysctl's

Submitted-by: Taras Klaskovsky
Sponsored-by: Google Code-In
4 years agodmirror - Add Matt's design notes
Alex Hornung [Thu, 25 Nov 2010 11:38:22 +0000 (11:38 +0000)]
dmirror - Add Matt's design notes

4 years agodmirror - initial code (layout)
Alex Hornung [Fri, 23 Jul 2010 19:54:11 +0000 (20:54 +0100)]
dmirror - initial code (layout)

* Initial code laying out basic functionality and design except for
  resynchronization.

* NOTE: this code is faaaaaaaaaaaar away from being usable. It really is
  only a layout.

* NOTE: did I mention that this code is far away from being usable and
  still needs a lot of love? The only reason I'm committing this, is so
  it doesn't linger forever on my personal repo.

* If anyone feels like it, *PLEASE* work on dmirror!!!!

4 years agodm - Major cleanup & module work
Alex Hornung [Thu, 25 Nov 2010 10:33:24 +0000 (10:33 +0000)]
dm - Major cleanup & module work

* Add module code to all the targets and get rid of the hackish global
  target insertion.

* Clean up all sorts of dead code and crappy whitespaces. There isn't
  much point in maintaining whitespaces just to have a small diff to
  NetBSD since our diff is quite big now anyways.

4 years agommap - add mmap offset randomization
Alex Hornung [Thu, 25 Nov 2010 08:18:15 +0000 (08:18 +0000)]
mmap - add mmap offset randomization

* mmap offset randomization, based upon OpenBSD's implementation in
  sys/uvm/uvm_map.c and sys/uvm/uvm_mmap.c.

* The randomization is controllable via the sysctl vm.randomize_mmap,
  which by default is 0 (off).

Obtained-from: OpenBSD

4 years agotr(1): Add the -C option.
Sascha Wildner [Thu, 25 Nov 2010 05:35:23 +0000 (06:35 +0100)]
tr(1): Add the -C option.

http://www.opengroup.org/onlinepubs/9699919799/utilities/tr.html

-C complements the set of characters specified by the first argument,
while -c complements the set of byte values specified by the first
argument.

Taken-from: FreeBSD

4 years agokernel - Honor MAP_WIREFUTURE flag in stack growth, mmap, and brk.
Venkatesh Srinivas [Thu, 25 Nov 2010 02:12:22 +0000 (18:12 -0800)]
kernel - Honor MAP_WIREFUTURE flag in stack growth, mmap, and brk.

This should complete a working version of mlockall(MCL_FUTURE).

4 years agokernel - Skeleton sys_mlockall.
Venkatesh Srinivas [Wed, 24 Nov 2010 21:47:13 +0000 (13:47 -0800)]
kernel - Skeleton sys_mlockall.

Currently implements MCL_FUTURE but not MCL_CURRENT.

4 years agohammer.8 - Avoid core dumping when running dedup
Ilya Dryomov [Wed, 24 Nov 2010 20:54:08 +0000 (22:54 +0200)]
hammer.8 - Avoid core dumping when running dedup

Avoid dumping core when a user runs dedup or dedup-simulate on a
meta-data only PFS (PFS which does not contain bulk data, just
softlinks, directory entries, etc).  Instead print out a 0.00 dedup
ratio.

Reported-by: Sascha Wildner <saw@online.de>
4 years agodm_target_crypt - use mpipe, add module magic
Alex Hornung [Wed, 24 Nov 2010 19:55:04 +0000 (19:55 +0000)]
dm_target_crypt - use mpipe, add module magic

* Switch the kmallocs in the I/O path to using mpipe with a bare minimum
  of two preallocated elements, for each read and write. This finally
  allows for an encrypted swap without any issues with memory pressure.
  It might also improve performance, but it is not the aim of the
  commit.

* Add some module magic to dm and make use of it in dm_target_crypt.

* (temporarily) remove the old module magic.

4 years agosysinit - add SI_SUB_DM_TARGETS
Alex Hornung [Wed, 24 Nov 2010 19:53:52 +0000 (19:53 +0000)]
sysinit - add SI_SUB_DM_TARGETS

4 years agodm - Fix a reference leak
Alex Hornung [Wed, 24 Nov 2010 19:52:52 +0000 (19:52 +0000)]
dm - Fix a reference leak

* References to the newly created target would not be released on an
  error, but they should. Otherwise dm_target_rem will never succeed if
  an error occured here.

4 years agoMerge branch 'master' of /repository/git/dragonfly
Venkatesh Srinivas [Wed, 24 Nov 2010 20:41:27 +0000 (12:41 -0800)]
Merge branch 'master' of /repository/git/dragonfly

4 years agokernel - Export vm_map_transition_wait and correct race between sleep/wakeup.
Venkatesh Srinivas [Wed, 24 Nov 2010 20:40:40 +0000 (12:40 -0800)]
kernel - Export vm_map_transition_wait and correct race between sleep/wakeup.

4 years agokernel - Implement munlockall.
Venkatesh Srinivas [Wed, 24 Nov 2010 20:25:07 +0000 (12:25 -0800)]
kernel - Implement munlockall.

4 years agoTest commit
Ilya Dryomov [Wed, 24 Nov 2010 19:26:27 +0000 (21:26 +0200)]
Test commit

4 years agokernel - Add a flags field to the vm_map and a MAP_WIREFUTURE flag.
Venkatesh Srinivas [Wed, 24 Nov 2010 19:15:58 +0000 (11:15 -0800)]
kernel - Add a flags field to the vm_map and a MAP_WIREFUTURE flag.

4 years agolibdm - clean libdm-dragonfly-iface
Alex Hornung [Wed, 24 Nov 2010 17:35:44 +0000 (17:35 +0000)]
libdm - clean libdm-dragonfly-iface

* Remove bogus whitespace.

* Remove dead code.

* Clean up a few comments.

* Remove prop_dictionary_externalize_to_file that were used for debug
  purposes.

4 years agonewfs - add volume name support
Alex Hornung [Wed, 24 Nov 2010 17:20:42 +0000 (17:20 +0000)]
newfs - add volume name support

Obtained-from: FreeBSD

4 years agofsid - clear buffer before reading
Alex Hornung [Wed, 24 Nov 2010 17:20:03 +0000 (17:20 +0000)]
fsid - clear buffer before reading

4 years agoFix a couple of typos in messages & manpages.
Sascha Wildner [Wed, 24 Nov 2010 13:22:06 +0000 (14:22 +0100)]
Fix a couple of typos in messages & manpages.

4 years agoarcmsr(4): Update to vendor release 1.20.00.19.
Sascha Wildner [Tue, 23 Nov 2010 13:08:49 +0000 (14:08 +0100)]
arcmsr(4): Update to vendor release 1.20.00.19.

Bug fixes:
  * Fixed "inquiry data fails comparion at DV1 step"
  * Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B
  * Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0

Taken-from: FreeBSD

4 years agoarcmsr(4): Fix up the device description a bit.
Sascha Wildner [Tue, 23 Nov 2010 11:41:36 +0000 (12:41 +0100)]
arcmsr(4): Fix up the device description a bit.

4 years agoprintf(1): Fix the printing of floats which I broke back in 2007.
Sascha Wildner [Tue, 23 Nov 2010 09:33:41 +0000 (10:33 +0100)]
printf(1): Fix the printing of floats which I broke back in 2007.

I forgot braces in f386bcf2683a4edef25828e3958ba5b087d702d2

4 years agokernel - Fix namecache memory exhaustion edge case
Matthew Dillon [Tue, 23 Nov 2010 07:24:25 +0000 (23:24 -0800)]
kernel - Fix namecache memory exhaustion edge case

* The namecache has traditionally relied on vnode limits to avoid
  blowing up its memory pool.  However, creating millions of hardlinks
  to the same vnode easily circumvents this assumption.

* Enhance the negative cache hysteresis code with a section for the
  positive cache that does the same thing, preventing the namecache
  from growing greater than 2x maxvnodes.

  This situation will not occur under normal operation, it is strictly
  for correctness.  The kernel should never panic on normal filesystem
  operations even if those operations are unrealistic.

* Tested w/HAMMER and a few million hardlinks to a single file.

Reported-by: Venkatesh Srinivas <me@acm.jhu.edu>
4 years agokernel - AHCI hotplug work to help support AMD chipsets
Matthew Dillon [Tue, 23 Nov 2010 02:25:33 +0000 (18:25 -0800)]
kernel - AHCI hotplug work to help support AMD chipsets

* Change the Hot-plug mechanics to something which appears to work for
  both NVidia and AMD AHCI chipsets, and hopefully Intel too (untested).

  This appears to fix hot-plug for AMD's SB850-based AHCI (circa AM3 socket
  mobos).

* Basically the SCTL.DET and CMD.SUD bits control the behavior of the
  SATA Phy, but in typical Intel fashion the specification is seriously
  lacking on how events such as hot-plug are handled based on what state
  the phy is in.

  Previously we were looking for phy transition events while holding
  the port in the RESET state (DET=1, SUD=1), which worked up till this
  point.  But it doesn't work with AMD's SB850-based AHCI.

  Now we are attempting to do the same thing with the port in
  the SPIN-UP/NORMAL state (DET=0, SUD=1).

* The AHCI documentation wants us to use the LISTEN mode (DET=0, SUD=0)
  and get a SERR.DIAG.X event for hot-plug but this doesn't seem to work
  very reliably.  In fact, 10.10.4 is ambiguous for the case
  where Staggered-spin-up is not supported since SUD is wired to '1'
  in that case (making LISTEN mode impossible).