]> www.infradead.org Git - users/hch/misc.git/commit
block: always verify unfreeze lock on the owner task
authorMing Lei <ming.lei@redhat.com>
Thu, 31 Oct 2024 13:37:19 +0000 (21:37 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 7 Nov 2024 23:27:22 +0000 (16:27 -0700)
commit6a78699838a0ddeed3620ddf50c1521f1fe1e811
tree00ddc0180be07470f1f8dd16d785b130ba6a477b
parenta471977780cc8ba809f84e3e2289d676063e7547
block: always verify unfreeze lock on the owner task

commit f1be1788a32e ("block: model freeze & enter queue as lock for
supporting lockdep") tries to apply lockdep for verifying freeze &
unfreeze. However, the verification is only done the outmost freeze and
unfreeze. This way is actually not correct because q->mq_freeze_depth
still may drop to zero on other task instead of the freeze owner task.

Fix this issue by always verifying the last unfreeze lock on the owner
task context, and make sure both the outmost freeze & unfreeze are
verified in the current task.

Fixes: f1be1788a32e ("block: model freeze & enter queue as lock for supporting lockdep")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241031133723.303835-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/blk-mq.c
block/blk.h
include/linux/blkdev.h