* [PATCH] block: cleanup q->srcu
@ 2022-01-11 12:34 Ming Lei
2022-01-17 3:32 ` Ming Lei
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ming Lei @ 2022-01-11 12:34 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, Ming Lei, syzbot+4f789823c1abc5accf13
srcu structure has to be cleanup via cleanup_srcu_struct(), so fix it.
Reported-by: syzbot+4f789823c1abc5accf13@syzkaller.appspotmail.com
Fixes: 704b914f15fb ("blk-mq: move srcu from blk_mq_hw_ctx to request_queue")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
block/blk-sysfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index e20eadfcf5c8..8d8549f71311 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -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);
}
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] block: cleanup q->srcu
2022-01-11 12:34 [PATCH] block: cleanup q->srcu Ming Lei
@ 2022-01-17 3:32 ` Ming Lei
2022-01-17 8:39 ` Christoph Hellwig
2022-01-17 14:24 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Ming Lei @ 2022-01-17 3:32 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, syzbot+4f789823c1abc5accf13
On Tue, Jan 11, 2022 at 08:34:01PM +0800, Ming Lei wrote:
> srcu structure has to be cleanup via cleanup_srcu_struct(), so fix it.
>
> Reported-by: syzbot+4f789823c1abc5accf13@syzkaller.appspotmail.com
> Fixes: 704b914f15fb ("blk-mq: move srcu from blk_mq_hw_ctx to request_queue")
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
> block/blk-sysfs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index e20eadfcf5c8..8d8549f71311 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: cleanup q->srcu
2022-01-11 12:34 [PATCH] block: cleanup q->srcu Ming Lei
2022-01-17 3:32 ` Ming Lei
@ 2022-01-17 8:39 ` Christoph Hellwig
2022-01-17 14:24 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-01-17 8:39 UTC (permalink / raw)
To: Ming Lei; +Cc: Jens Axboe, linux-block, syzbot+4f789823c1abc5accf13
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: cleanup q->srcu
2022-01-11 12:34 [PATCH] block: cleanup q->srcu Ming Lei
2022-01-17 3:32 ` Ming Lei
2022-01-17 8:39 ` Christoph Hellwig
@ 2022-01-17 14:24 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-01-17 14:24 UTC (permalink / raw)
To: Ming Lei; +Cc: syzbot+4f789823c1abc5accf13, linux-block
On Tue, 11 Jan 2022 20:34:01 +0800, Ming Lei wrote:
> 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,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-17 14:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 12:34 [PATCH] block: cleanup q->srcu Ming Lei
2022-01-17 3:32 ` Ming Lei
2022-01-17 8:39 ` Christoph Hellwig
2022-01-17 14:24 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).