Skip to contentSkip to conversation

block: cleanup q->srcu

PATCH Applied Ming Lei 3 participants 4 messages Jan 11, 2022 – Jan 17, 2022 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 block: cleanup q->srcu

srcu structure has to be cleanup via cleanup_srcu_struct(), so fix it.

Reported-by [email protected]
Fixes 704b914f15fb ("blk-mq: move srcu from blk_mq_hw_ctx to request_queue")
---
 block/blk-sysfs.c | 3 +++
 1 file changed, 3 insertions(+)
block/blk-sysfs.c +3 -0
index e20eadfcf5c8..8d8549f71311 100644
@@ -811,6 +811,9 @@ static void blk_release_queue(struct kobject *kobj)
 
 	bioset_exit(&q->bio_split);
 
+	if (blk_queue_has_srcu(q))
+		cleanup_srcu_struct(q->srcu);
+
 	ida_simple_remove(&blk_queue_ida, q->id);
 	call_rcu(&q->rcu_head, blk_free_queue_rcu);
 }
Signature · 1 line
2.31.1
author
#1 lore raw
Quoted 14 lines · Ming Lei

srcu structure has to be cleanup via cleanup_srcu_struct(), so fix it.

Reported-by [email protected]
Fixes 704b914f15fb ("blk-mq: move srcu from blk_mq_hw_ctx to request_queue")
---
 block/blk-sysfs.c | 3 +++
 1 file changed, 3 insertions(+)
block/blk-sysfs.c +0 -0
index e20eadfcf5c8..8d8549f71311 100644

block/blk-sysfs.c static void blk_release_queue(struct kobject *kobj) · line 818

Quoted 8 lines
block/blk-sysfs.c +3 -0
@@ -811,6 +811,9 @@ static void blk_release_queue(struct kobject *kobj)
 
 	bioset_exit(&q->bio_split);
 
+	if (blk_queue_has_srcu(q))
+		cleanup_srcu_struct(q->srcu);
+
 	ida_simple_remove(&blk_queue_ida, q->id);
 	call_rcu(&q->rcu_head, blk_free_queue_rcu);

Hello Jens,

Can we make it into mainline to fix the recent syzbot report?

Thanks,
Ming

maintainer Applied
#3 lore raw
In reply to Ming Lei
Quoted 3 lines · Ming Lei

srcu structure has to be cleanup via cleanup_srcu_struct(), so fix it.

Applied, thanks!

[1/1] block: cleanup q->srcu

      commit: 850fd2abbe02eb2b52cbb1550adbcc89b36d65de

Best regards,

Signature · 1 line
Jens Axboe