diff mbox

[1/1] : missing call to pg_init_done causes I/O to be hung forever

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

Commit Message

babu moger Dec. 13, 2010, 6:02 p.m. UTC
None
diff mbox

Patch

diff -r -U 2 a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
--- a/drivers/md/dm-mpath.c   2010-12-13 09:16:31.358858000 +0200
+++ b/drivers/md/dm-mpath.c   2010-12-13 09:16:31.796998000 +0200
@@ -1190,4 +1190,5 @@ 
      case SCSI_DH_OK:
            break;
+     case SCSI_DH_DEV_OFFLINED:

If you are not doing anything special then I would let default take care of it.  No need of this change..

      case SCSI_DH_NOSYS:
            if (!m->hw_handler_name) {
@@ -1252,7 +1253,15 @@ 
 {
      struct pgpath *pgpath = (struct pgpath *) data;
+     int err;

-     scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev),
+     err = scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev),
                        pg_init_done, &pgpath->path);
+
+     /*
+     * If error is not SCSI_DH_OK, we have not entered the scsi_dh H/W handler and did not call pg_init_done -
+     * need to call pg_init_done directly.
+     */
+     if (err)
+           pg_init_done(&pgpath->path, err);
 }
You can move this to scsi_dh.c


diff -r -U 2 a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c
--- a/drivers/scsi/device_handler/scsi_dh.c     2010-12-13 09:16:31.616554000 +0200
+++ b/drivers/scsi/device_handler/scsi_dh.c     2010-12-13 09:16:31.878170000 +0200
@@ -443,4 +443,9 @@ 
      spin_unlock_irqrestore(q->queue_lock, flags);

+     if (sdev->sdev_state == SDEV_CANCEL ||
+         sdev->sdev_state == SDEV_DEL ||
+         sdev->sdev_state == SDEV_OFFLINE)
+           err = SCSI_DH_DEV_OFFLINED;
+
You can change it something like below..
      if (err) {