From: Bart Van Assche <bvanassche@acm.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
James Bottomley <jbottomley@parallels.com>,
Jun'ichi Nomura <j-nomura@ce.jp.nec.com>,
Mike Christie <michaelc@cs.wisc.edu>,
Stefan Richter <stefanr@s5r6.in-berlin.de>,
Tomas Henzl <thenzl@redhat.com>,
Mike Snitzer <snitzer@redhat.com>
Subject: [PATCH 3/3] Make scsi_free_queue() abort pending requests
Date: Fri, 04 May 2012 15:07:29 +0000 [thread overview]
Message-ID: <4FA3F0B1.9040207@acm.org> (raw)
In-Reply-To: <4FA3EF10.3040104@acm.org>
It is possible that a SCSI LLD invokes scsi_remove_host() after a
request has been queued via scsi_host_template.queuecommand() but
before scsi_done() has been invoked for that request. This may
cause the SCSI error handler to start processing a timeout long
after scsi_remove_host() finished. This may even cause LLD error
handler functions to be invoked after the LLD kernel module has
been removed. Change this behavior such that the SCSI error
handler no longer invokes timeout processing after
scsi_remove_host() finished.
Note: blk_abort_queue() indirectly invokes the SCSI LLD
eh_abort_handler. This patch may cause that abort handler to be
invoked before the SCSI timeout elapsed. Hence follow-up
patches may be necessary to fix race conditions in LLDs that
expect that the abort handler is only invoked after the SCSI
timeout elapsed. Maybe this is why a similar patch has been
reverted about a year ago (see also commit
09c9d4c9b6a2b5909ae3c6265e4cd3820b636863).
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: James Bottomley <jbottomley@parallels.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Tomas Henzl <thenzl@redhat.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
---
drivers/scsi/scsi_sysfs.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index f8fc240..a61051d 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -963,6 +963,7 @@ void __scsi_remove_device(struct scsi_device *sdev)
* scsi_device_dev_release_usercontext().
*/
blk_cleanup_queue(q);
+ blk_abort_queue(q);
if (sdev->is_visible) {
if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
--
1.7.7
next prev parent reply other threads:[~2012-05-04 15:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-04 15:00 [PATCH 0/3 v6] Fixes for SCSI device removal Bart Van Assche
2012-05-04 15:03 ` [PATCH 1/3] sd: Fix device removal NULL pointer dereference Bart Van Assche
2012-05-04 15:06 ` [PATCH 2/3] Stop accepting SCSI requests before removing a device Bart Van Assche
2012-05-04 20:16 ` Mike Christie
2012-05-04 20:30 ` Mike Christie
2012-05-05 13:04 ` Bart Van Assche
2012-05-29 15:00 ` Bart Van Assche
2012-05-29 17:35 ` Mike Christie
2012-05-30 6:56 ` Bart Van Assche
2012-05-30 17:27 ` Mike Christie
2012-05-30 20:00 ` Bart Van Assche
2012-06-01 3:13 ` Mike Christie
2012-05-04 15:07 ` Bart Van Assche [this message]
2012-05-04 20:25 ` [PATCH 3/3] Make scsi_free_queue() abort pending requests Mike Christie
2012-05-04 20:32 ` Mike Christie
2012-05-05 6:07 ` Bart Van Assche
2012-05-07 0:44 ` Mike Christie
2012-05-07 1:15 ` Mike Christie
2012-05-14 18:43 ` Bart Van Assche
2012-05-29 14:56 ` Bart Van Assche
2012-05-05 13:41 ` Bart Van Assche
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=4FA3F0B1.9040207@acm.org \
--to=bvanassche@acm.org \
--cc=j-nomura@ce.jp.nec.com \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=snitzer@redhat.com \
--cc=stefanr@s5r6.in-berlin.de \
--cc=thenzl@redhat.com \
/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.