All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: call bio_associate_blkg from bio_reset
@ 2022-02-04  7:19 Christoph Hellwig
  2022-02-04  8:13 ` Chaitanya Kulkarni
  2022-02-04 13:33 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-02-04  7:19 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, syzbot+2b3f18414c37b42dcc94

Call bio_associate_blkg just like bio_set_dev did in the callers before
the conversion to set the block device in bio_reset.

Fixes: a7c50c940477 ("block: pass a block_device and opf to bio_reset")
Reported-by: syzbot+2b3f18414c37b42dcc94@syzkaller.appspotmail.com
Tested-by: syzbot+2b3f18414c37b42dcc94@syzkaller.appspotmail.com
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/bio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/bio.c b/block/bio.c
index 2e19ca600fcdb..d2f3c10350364 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -310,6 +310,8 @@ void bio_reset(struct bio *bio, struct block_device *bdev, unsigned int opf)
 	memset(bio, 0, BIO_RESET_BYTES);
 	atomic_set(&bio->__bi_remaining, 1);
 	bio->bi_bdev = bdev;
+	if (bio->bi_bdev)
+		bio_associate_blkg(bio);
 	bio->bi_opf = opf;
 }
 EXPORT_SYMBOL(bio_reset);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: call bio_associate_blkg from bio_reset
  2022-02-04  7:19 [PATCH] block: call bio_associate_blkg from bio_reset Christoph Hellwig
@ 2022-02-04  8:13 ` Chaitanya Kulkarni
  2022-02-04 13:33 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2022-02-04  8:13 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, syzbot+2b3f18414c37b42dcc94

On 2/3/22 23:19, Christoph Hellwig wrote:
> Call bio_associate_blkg just like bio_set_dev did in the callers before
> the conversion to set the block device in bio_reset.
> 
> Fixes: a7c50c940477 ("block: pass a block_device and opf to bio_reset")
> Reported-by: syzbot+2b3f18414c37b42dcc94@syzkaller.appspotmail.com
> Tested-by: syzbot+2b3f18414c37b42dcc94@syzkaller.appspotmail.com
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

This fixes the issue mentioned by Jens on the report,
not sure if I can add reviewed-by after tested by tag,
if not, please drop reviewed-by tag..

Tested-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>


-ck


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: call bio_associate_blkg from bio_reset
  2022-02-04  7:19 [PATCH] block: call bio_associate_blkg from bio_reset Christoph Hellwig
  2022-02-04  8:13 ` Chaitanya Kulkarni
@ 2022-02-04 13:33 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2022-02-04 13:33 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: syzbot+2b3f18414c37b42dcc94, linux-block

On Fri, 4 Feb 2022 08:19:34 +0100, Christoph Hellwig wrote:
> Call bio_associate_blkg just like bio_set_dev did in the callers before
> the conversion to set the block device in bio_reset.
> 
> 

Applied, thanks!

[1/1] block: call bio_associate_blkg from bio_reset
      commit: 78e3437450be5236c4949e377c9b848bbcd4fcb0

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-04 13:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04  7:19 [PATCH] block: call bio_associate_blkg from bio_reset Christoph Hellwig
2022-02-04  8:13 ` Chaitanya Kulkarni
2022-02-04 13:33 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.