]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
restore mutex_lock() call to blk_mq_freeze_queue_start()
authorDan Duval <dan.duval@oracle.com>
Mon, 27 Mar 2017 13:20:01 +0000 (09:20 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 15 Jun 2017 03:17:15 +0000 (20:17 -0700)
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 <dan.duval@oracle.com>
block/blk-mq.c

index fbb886bd96ec5d11c42cc93898f119a38cb27b50..7b9fab7d97f65c4137394367d005a811a5191115 100644 (file)
@@ -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) {