dmsg - Stabilization work
commita06d536b271ede1f577aaea9cbc372a2fc2a096e
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 3 Mar 2015 06:21:23 +0000 (2 22:21 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 3 Mar 2015 06:21:23 +0000 (2 22:21 -0800)
tree25bd01cf85bd403d9357fe8a244ac8dff560412d
parent79ff9003126fde1798a9d3efa9fb4e3e87f2ba46
dmsg - Stabilization work

* Add a refs field to dmsg_state and kdmsg_state for retention and
  disposal.

* Separate out the tracking of state->subq and the state RB trees.

* Greatly simplify the iocom shutdown code and functions related
  to handling communications failures.  When iterating states for
  shutdown, which requires simulating a received failure message,
  we can now simply iterate via state->subq.

* Greatly simplify how the simulated failures are generated and
  handled (See dmsg_msg_simulate_failure()).  This is probably the
  most complex part of the library.

* Fix a memory leak in kern_dmsg.c.

* Replace xdisk's per-softc token with a lockmgr lock.  Atomicy
  has to be guaranteed across blocking conditions in certain cases
  and it was easier to simply use a lock for everything.

  Cleanup the locking.

* Ripout the shutdown check in the I/O path, which can deadlock
  the disk management threads.  This will need to be revisited
  as it means that /dev/xa* and /dev/serno* devices remain in
  /dev after a link failure even when there are no opens on the
  device.

* Add the B_FAILONDIS flag to struct buf.  This flag allows the disk
  probe code to tell xdisk that it is ok for the I/O to fail, allowing
  xdisk to discard I/Os that would otherwise block or deadlock the
  disk probe code when the related network connection is lost.
lib/libdmsg/dmsg.h
lib/libdmsg/msg.c
sys/dev/disk/xdisk/xdisk.c
sys/kern/kern_dmsg.c
sys/kern/subr_diskgpt.c
sys/kern/subr_disklabel32.c
sys/kern/subr_disklabel64.c
sys/kern/subr_diskmbr.c
sys/sys/buf.h
sys/sys/dmsg.h