public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <James.Smart@Emulex.Com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH] scsi_scan.c : add missing interim SDEV_DEL state if slave_alloc fails
Date: Tue, 27 Jan 2009 10:39:58 -0500	[thread overview]
Message-ID: <1233070798.22506.5.camel@ogier> (raw)


We were running i/o and performing a bunch of hba resets in a loop.
This forces a lot of target removes and rescans. Since the resets
are occuring during scan it's causing the scan i/o to timeout or fail,
invoking error recovery, etc.  We end up getting a nasty crash
in scsi_scan.c due to references to old sdevs that had some
lingering references that kept them around.

Fix by setting device state to SDEV_DEL if the LLD's slave_alloc
fails. This will fail reference taking in subsequent teardown/scan paths.

-- james s


 Signed-off-by: James Smart <james.smart@emulex.com>

 ---

 scsi_scan.c |    1 +
 1 file changed, 1 insertion(+)


diff -upNr a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
--- a/drivers/scsi/scsi_scan.c	2009-01-27 09:44:31.000000000 -0500
+++ b/drivers/scsi/scsi_scan.c	2009-01-27 10:12:04.000000000 -0500
@@ -310,6 +310,7 @@ static struct scsi_device *scsi_alloc_sd
 			 */
 			if (ret == -ENXIO)
 				display_failure_msg = 0;
+			scsi_device_set_state(sdev, SDEV_DEL);
 			goto out_device_destroy;
 		}
 	}



             reply	other threads:[~2009-01-27 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27 15:39 James Smart [this message]
2009-01-27 16:27 ` [PATCH] scsi_scan.c : add missing interim SDEV_DEL state if slave_alloc fails James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1233070798.22506.5.camel@ogier \
    --to=james.smart@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox