summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index d14317bfdf65..8ab21dd01cd1 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -260,8 +260,6 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head)
static void blk_free_queue(struct request_queue *q)
{
- might_sleep();
-
percpu_ref_exit(&q->q_usage_counter);
if (q->poll_stat)
@@ -285,11 +283,11 @@ static void blk_free_queue(struct request_queue *q)
* Decrements the refcount of the request_queue and free it when the refcount
* reaches 0.
*
- * Context: Any context, but the last reference must not be dropped from
- * atomic context.
+ * Context: Can sleep.
*/
void blk_put_queue(struct request_queue *q)
{
+ might_sleep();
if (refcount_dec_and_test(&q->refs))
blk_free_queue(q);
}