[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)
committerVarun Wadekar <vwadekar@nvidia.com>
Mon, 14 May 2012 12:36:07 +0000 (17:36 +0530)
commitef0c2b28ddcf8e0cc515f02e75967e2a787ab669
tree6855197502c8dcbe90b830a3cca02bbd747be4e3
parent239f5e50d93f3fc0b0f8eaa23986c0e6934580bd
[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