summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2024-10-25 08:37:18 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-05 14:03:05 +0100
commit9c3d53f113426d2f0f49ca13afabca13f5b1a5af (patch)
treec8f977d8b5d29faed88f3f179e61e52f20236763 /block
parent4eaa19c6205c370b1c055140b68ff77816d8abf3 (diff)
downloadlinux-9c3d53f113426d2f0f49ca13afabca13f5b1a5af.tar.gz
linux-9c3d53f113426d2f0f49ca13afabca13f5b1a5af.tar.bz2
linux-9c3d53f113426d2f0f49ca13afabca13f5b1a5af.zip
blk-mq: add non_owner variant of start_freeze/unfreeze queue APIs
[ Upstream commit 8acdd0e7bfadda6b5103f2960d293581954454ed ] Add non_owner variant of start_freeze/unfreeze queue APIs, so that the caller knows that what they are doing, and we can skip lockdep support for non_owner variant in per-call level. Prepare for supporting lockdep for freezing/unfreezing queue. Reviewed-by: Christoph Hellwig <hch@lst.de> Suggested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20241025003722.3630252-2-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Stable-dep-of: 3802f73bd807 ("block: fix uaf for flush rq while iterating tags") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index fbd63d189c74..0beed0ae0aeb 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -197,6 +197,26 @@ void blk_mq_unfreeze_queue(struct request_queue *q)
EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue);
/*
+ * non_owner variant of blk_freeze_queue_start
+ *
+ * Unlike blk_freeze_queue_start, the queue doesn't need to be unfrozen
+ * by the same task. This is fragile and should not be used if at all
+ * possible.
+ */
+void blk_freeze_queue_start_non_owner(struct request_queue *q)
+{
+ blk_freeze_queue_start(q);
+}
+EXPORT_SYMBOL_GPL(blk_freeze_queue_start_non_owner);
+
+/* non_owner variant of blk_mq_unfreeze_queue */
+void blk_mq_unfreeze_queue_non_owner(struct request_queue *q)
+{
+ __blk_mq_unfreeze_queue(q, false);
+}
+EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue_non_owner);
+
+/*
* FIXME: replace the scsi_internal_device_*block_nowait() calls in the
* mpt3sas driver such that this function can be removed.
*/