diff mbox

: scsi_dh_rdac: fix BUG_ON in get_rdac_data from within send_mode_select

Message ID E463DF2B2E584B4A82673F53D62C2EF4FF372CBD@cosmail01.lsi.com (mailing list archive)
State Deferred, archived
Headers show

Commit Message

babu moger Jan. 31, 2011, 8:38 p.m. UTC
None
diff mbox

Patch

diff -r -U 2 a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c        2011-01-30 11:02:31.271426000 +0200
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c        2011-01-30 11:02:31.327069000 +0200
@@ -853,8 +853,22 @@ 
        spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
        scsi_dh_data = retrieve_scsi_dh_data(sdev);
-       store_scsi_dh_data(sdev, NULL);
        spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);

        h = (struct rdac_dh_data *) scsi_dh_data->buf;
+       if (h->ctlr) {
+               int flush;
+
+               spin_lock(&h->ctlr->ms_lock);
+               flush = (h->ctlr->ms_sdev == sdev);
+               spin_unlock(&h->ctlr->ms_lock);
+
+               if (flush)
+                       flush_workqueue(kmpath_rdacd);
+       }
+
+       spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
+       store_scsi_dh_data(sdev, NULL);
+       spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
+
        if (h->ctlr)
                kref_put(&h->ctlr->kref, release_controller);