From 08ea70d8069967045946080e7b16a2ea5cf91d9e Mon Sep 17 00:00:00 2001 From: Dan Duval Date: Mon, 27 Mar 2017 09:20:01 -0400 Subject: [PATCH] restore mutex_lock() call to blk_mq_freeze_queue_start() Orabug: 26266901 Over-eager editing for conflict resolution in merge commit c311ca8a3d9349dfc606cada0d8ca14e58728c9c ("Merge tag 'v4.1.12-70#22913653a12' into pmem-4.1-merge") resulted in the accidental deletion of two calls to mutex_lock(). Since the matching calls to mutex_unlock() were correctly left in the source, this produced a lock imbalance, detectable via lockdep. This commit restores the missing mutex_lock() calls. Signed-off-by: Dan Duval --- block/blk-mq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index fbb886bd96ec..7b9fab7d97f6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -81,6 +81,7 @@ void blk_mq_freeze_queue_start(struct request_queue *q) { int freeze_depth; + mutex_lock(&q->mq_freeze_lock); freeze_depth = atomic_inc_return(&q->mq_freeze_depth); if (freeze_depth == 1) { percpu_ref_kill(&q->q_usage_counter); @@ -126,6 +127,7 @@ void blk_mq_unfreeze_queue(struct request_queue *q) { int freeze_depth; + mutex_lock(&q->mq_freeze_lock); freeze_depth = atomic_dec_return(&q->mq_freeze_depth); WARN_ON_ONCE(freeze_depth < 0); if (!freeze_depth) { -- 2.50.1