linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Proposed fix for scsi related boot crash
@ 2012-01-19 11:41 Stanislaw Gruszka
  2012-01-19 21:10 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislaw Gruszka @ 2012-01-19 11:41 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC] Proposed fix for scsi related boot crash
  2012-01-19 11:41 [RFC] Proposed fix for scsi related boot crash Stanislaw Gruszka
@ 2012-01-19 21:10 ` James Bottomley
  0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2012-01-19 21:10 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: linux-scsi

On Thu, 2012-01-19 at 12:41 +0100, Stanislaw Gruszka wrote:
> 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

It will be fixed in stable by

commit cced5041ed5a2d1352186510944b0ddfbdbe4c0b
Author: Stratos Psomadakis <psomas@gentoo.org>
Date:   Sun Dec 4 02:23:54 2011 +0200

    [SCSI] sym53c8xx: Fix NULL pointer dereference in slave_destroy


James



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-19 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-19 11:41 [RFC] Proposed fix for scsi related boot crash Stanislaw Gruszka
2012-01-19 21:10 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).