All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org
Subject: [RFC] Proposed fix for scsi related boot crash
Date: Thu, 19 Jan 2012 12:41:28 +0100	[thread overview]
Message-ID: <20120119114127.GC6514@redhat.com> (raw)

Hi

We have fedora bug report where system crash at boot when SCSI card is
plugged into the system:
https://bugzilla.redhat.com/show_bug.cgi?id=781625

Since it is 3.1.2 -> 3.1.4 regression, it was easy to find out that
the problem is caused by:

commit 4e6c82b3614a18740ef63109d58743a359266daf
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date:   Mon Nov 7 08:51:24 2011 -0600

    [SCSI] fix WARNING: at drivers/scsi/scsi_lib.c:1704
 
User confirmed that reverting the commit fixed the problem (and
generates lot's of scsi/scsi_lib.c:1704 warnings).

The remain question is how to properly fix. My proposition is to
revert 4e6c82b361 and nullify sdev->request_queue->queuedata what
should fix the warning.

Thanks
Stanislaw

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 89da43f..fcc8b53 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -319,7 +319,15 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
 	return sdev;
 
 out_device_destroy:
-	__scsi_remove_device(sdev);
+	scsi_device_set_state(sdev, SDEV_DEL);
+	transport_destroy_device(&sdev->sdev_gendev);
+	put_device(&sdev->sdev_dev);
+
+	/* stop the block layer for our device */
+	sdev->request_queue->queuedata = NULL;
+	scsi_free_queue(sdev->request_queue);
+
+	put_device(&sdev->sdev_gendev);
 out:
 	if (display_failure_msg)
 		printk(ALLOC_FAILURE_MSG, __func__);

             reply	other threads:[~2012-01-19 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 11:41 Stanislaw Gruszka [this message]
2012-01-19 21:10 ` [RFC] Proposed fix for scsi related boot crash 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=20120119114127.GC6514@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=James.Bottomley@HansenPartnership.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.