Skip to content

Commit 7737b1b

Browse files
Christoph HellwigEric Biggers
authored andcommitted
ext4: initialize the write hint in io_submit_init_bio
Make io_submit_init_bio complete by also initializing the write hint. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20260302141922.370070-2-hch@lst.de Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent 1f318b9 commit 7737b1b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/ext4/page-io.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ void ext4_io_submit_init(struct ext4_io_submit *io,
416416
}
417417

418418
static void io_submit_init_bio(struct ext4_io_submit *io,
419+
struct inode *inode,
419420
struct buffer_head *bh)
420421
{
421422
struct bio *bio;
@@ -429,6 +430,7 @@ static void io_submit_init_bio(struct ext4_io_submit *io,
429430
bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
430431
bio->bi_end_io = ext4_end_bio;
431432
bio->bi_private = ext4_get_io_end(io->io_end);
433+
bio->bi_write_hint = inode->i_write_hint;
432434
io->io_bio = bio;
433435
io->io_next_block = bh->b_blocknr;
434436
wbc_init_bio(io->io_wbc, bio);
@@ -445,10 +447,8 @@ static void io_submit_add_bh(struct ext4_io_submit *io,
445447
submit_and_retry:
446448
ext4_io_submit(io);
447449
}
448-
if (io->io_bio == NULL) {
449-
io_submit_init_bio(io, bh);
450-
io->io_bio->bi_write_hint = inode->i_write_hint;
451-
}
450+
if (io->io_bio == NULL)
451+
io_submit_init_bio(io, inode, bh);
452452
if (!bio_add_folio(io->io_bio, io_folio, bh->b_size, bh_offset(bh)))
453453
goto submit_and_retry;
454454
wbc_account_cgroup_owner(io->io_wbc, folio, bh->b_size);

0 commit comments

Comments
 (0)