From: Anton Blanchard <anton@samba.org>
To: Bart Van Assche <bvanassche@acm.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-scsi@vger.kernel.org
Subject: [PATCH] [SCSI] scsi_alloc_sdev() trips WARN_ON in scsi_free_queue()
Date: Tue, 8 Nov 2011 12:36:23 +1100 [thread overview]
Message-ID: <20111108123623.1a94db09@kryten> (raw)
In-Reply-To: <CAO+b5-paS698V61BA8e4ZYstdqR4AKda2EKx4DHqv4gtR2ocPA@mail.gmail.com>
commit 3308511c93e6 ([SCSI] Make scsi_free_queue() kill pending SCSI
commands) requires us to reset the queuedata pointer before calling
scsi_free_queue.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Thanks for the tip Bart, does this look good?
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 72273a0..ebb1206 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -322,6 +322,7 @@ out_device_destroy:
scsi_device_set_state(sdev, SDEV_DEL);
transport_destroy_device(&sdev->sdev_gendev);
put_device(&sdev->sdev_dev);
+ sdev->request_queue->queuedata = NULL;
scsi_free_queue(sdev->request_queue);
put_device(&sdev->sdev_gendev);
out:
next prev parent reply other threads:[~2011-11-08 1:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-07 6:24 WARNING: at drivers/scsi/scsi_lib.c:1704 Stephen Rothwell
2011-11-07 7:33 ` Bart Van Assche
2011-11-08 1:36 ` Anton Blanchard [this message]
2011-11-07 14:51 ` James Bottomley
2011-11-08 0:03 ` Stephen Rothwell
2011-11-08 0:36 ` Stephen Rothwell
2011-11-08 7:07 ` Bart Van Assche
2011-11-08 8:49 ` Stephen Rothwell
2011-11-16 20:58 ` Luis Henriques
2011-11-08 15:30 ` Hannes Reinecke
2011-11-10 15:51 ` Steffen Maier
2011-11-10 16:06 ` 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=20111108123623.1a94db09@kryten \
--to=anton@samba.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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