diff options
| author | Ming Lei <ming.lei@redhat.com> | 2024-10-31 21:37:19 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 14:03:10 +0100 |
| commit | b12cfcae8a83140d949dfaad7b19c37275069f81 (patch) | |
| tree | 9452ed65d592d247a53ef9c89c2611a26f231c5b /include | |
| parent | a14ab9f3c9377476d9977291fc7123dbcfb1e694 (diff) | |
| download | linux-b12cfcae8a83140d949dfaad7b19c37275069f81.tar.gz linux-b12cfcae8a83140d949dfaad7b19c37275069f81.tar.bz2 linux-b12cfcae8a83140d949dfaad7b19c37275069f81.zip | |
block: always verify unfreeze lock on the owner task
commit 6a78699838a0ddeed3620ddf50c1521f1fe1e811 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/blkdev.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d99054218764..e84a93c40132 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -572,6 +572,10 @@ struct request_queue { struct throtl_data *td; #endif struct rcu_head rcu_head; +#ifdef CONFIG_LOCKDEP + struct task_struct *mq_freeze_owner; + int mq_freeze_owner_depth; +#endif wait_queue_head_t mq_freeze_wq; /* * Protect concurrent access to q_usage_counter by |
