@@ -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);