[SCSI] libsas: introduce sas_work to fix sas_drain_work vs sas_queue_work
authorDan Williams <dan.j.williams@intel.com>
Fri, 9 Mar 2012 19:00:06 +0000 (11:00 -0800)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 23 Apr 2012 11:03:39 +0000 (12:03 +0100)
commit22b9153faa2263aa89625de25e71c7d44c8dbd16
tree1157d64a9c63c5b7b48b4a5b3610965d8d4c9624
parentf8fc75dc576eac0c996e4a792a4701819d999260
[SCSI] libsas: introduce sas_work to fix sas_drain_work vs sas_queue_work

When requeuing work to a draining workqueue the last work instance may
not be idle, so sas_queue_work() must not touch work->entry.  Introduce
sas_work with a drain_node list_head to have a private list for
collecting work deferred due to drain collision.

Fixes reports like:
  BUG: unable to handle kernel NULL pointer dereference at           (null)
  IP: [<ffffffff810410d4>] process_one_work+0x2e/0x338

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/libsas/sas_discover.c
drivers/scsi/libsas/sas_event.c
drivers/scsi/libsas/sas_init.c
drivers/scsi/libsas/sas_internal.h
drivers/scsi/libsas/sas_phy.c
drivers/scsi/libsas/sas_port.c
include/scsi/libsas.h