projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7afafc8
)
block: Fix race triggered by blk_set_queue_dying()
author
Bart Van Assche
<
[email protected]
>
Tue, 16 Aug 2016 23:48:36 +0000
(16:48 -0700)
committer
Jens Axboe
<
[email protected]
>
Wed, 17 Aug 2016 01:36:14 +0000
(19:36 -0600)
blk_set_queue_dying() can be called while another thread is
submitting I/O or changing queue flags, e.g. through dm_stop_queue().
Hence protect the QUEUE_FLAG_DYING flag change with locking.
Signed-off-by: Bart Van Assche <
[email protected]
>
Cc: Christoph Hellwig <
[email protected]
>
Cc: Mike Snitzer <
[email protected]
>
Cc: stable <
[email protected]
>
Signed-off-by: Jens Axboe <
[email protected]
>
block/blk-core.c
patch
|
blob
|
history
diff --git
a/block/blk-core.c
b/block/blk-core.c
index 999442ec4601487a35c76dad156dfa438a2a35b3..36c7ac328d8c17bd1967f898c91ff49f7a9b050d 100644
(file)
--- a/
block/blk-core.c
+++ b/
block/blk-core.c
@@
-515,7
+515,9
@@
EXPORT_SYMBOL_GPL(blk_queue_bypass_end);
void blk_set_queue_dying(struct request_queue *q)
{
- queue_flag_set_unlocked(QUEUE_FLAG_DYING, q);
+ spin_lock_irq(q->queue_lock);
+ queue_flag_set(QUEUE_FLAG_DYING, q);
+ spin_unlock_irq(q->queue_lock);
if (q->mq_ops)
blk_mq_wake_waiters(q);