From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] block: fix oops in blk_run_queue()
Date: Tue, 24 May 2011 13:18:51 -0400 [thread overview]
Message-ID: <1306257531.10201.20.camel@mulgrave.site> (raw)
In-Reply-To: <201105191944.p4JJiVVm029690@demeter1.kernel.org>
Bugzilla report is here:
https://bugzilla.kernel.org/show_bug.cgi?id=35682
The problem occurs if blk_run_queue() or its variants is called after
blk_cleanup_queue() is called. The run checks should have a state guard
for QUEUE_FLAG_DEAD. Since a DEAD queue is always STOPPED, just fold it
into the blk_queue_stopped() test.
Signed-off-by: James Bottomley <jbottomley@parallels.com>
---
Jens, can you look at this, please ... would you prefer a separate DEAD
test instead? Incidentally, this is in addition to the other DEAD test
you still haven't applied ...
James
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2ad95fa..8166845 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -473,7 +473,9 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
}
#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
-#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
+#define blk_queue_stopped(q) \
+ (test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) || \
+ test_bit(QUEUE_FLAG_DEAD, &(q)->queue_flags))
#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
#define blk_queue_noxmerges(q) \
test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-05-24 21:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-35282-11613@https.bugzilla.kernel.org/>
2011-05-17 19:17 ` [Bug 35282] BUG() in 2.6.38.6 bugzilla-daemon
2011-05-17 19:55 ` James Bottomley
2011-05-17 20:33 ` bugzilla-daemon
2011-05-19 19:44 ` bugzilla-daemon
2011-05-21 20:30 ` James Bottomley
2011-05-24 17:18 ` James Bottomley [this message]
2011-05-25 11:28 ` [PATCH] block: fix oops in blk_run_queue() Jens Axboe
2011-05-21 20:31 ` [Bug 35282] BUG() in 2.6.38.6 bugzilla-daemon
2011-05-21 21:40 ` bugzilla-daemon
2011-05-27 9:53 ` bugzilla-daemon
2011-05-28 16:56 ` James Bottomley
2011-05-28 16:57 ` bugzilla-daemon
2011-06-12 20:54 ` bugzilla-daemon
2011-06-12 20:55 ` bugzilla-daemon
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=1306257531.10201.20.camel@mulgrave.site \
--to=james.bottomley@hansenpartnership.com \
--cc=axboe@kernel.dk \
--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;
as well as URLs for NNTP newsgroup(s).