From: sashiko-bot@kernel.org
To: guolingxing <guolingxing@tju.edu.cn>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH 1/3] ext4: check return value of blkdev_issue_flush() when initializing inode tables
Date: Tue, 13 Oct 2026 06:39:35 +0000 [thread overview]
Message-ID: <sashiko-outbox-169116@kernel.org> (raw)
In-Reply-To: <20261013062618.1741670-1-guolingxing@tju.edu.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ext4: lazyinit thread ignores nobarrier mount option and aborts on flush error
--
commit 06e54e3a165a1e8b6269f6dbdf6487defdbf7915
Author: guolingxing <guolingxing@tju.edu.cn>
ext4: check return value of blkdev_issue_flush() when initializing inode tables
This commit checks the return value of blkdev_issue_flush() when lazily
zeroing inode tables to prevent exposing stale data if the flush fails.
By leaving the EXT4_BG_INODE_ZEROED flag unset on failure, it ensures
the zeroing is retried on the next mount.
> diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
> index f97a2f4904ebb..843a78fc6e51a 100644
> --- a/fs/ext4/ialloc.c
> +++ b/fs/ext4/ialloc.c
[ ... ]
> @@ -1611,8 +1611,11 @@ int ext4_init_inode_table(struct super_block *sb, ext4_group_t group,
> ret = sb_issue_zeroout(sb, blk, num, GFP_NOFS);
> if (ret < 0)
> goto err_out;
> - if (barrier)
> - blkdev_issue_flush(sb->s_bdev);
> + if (barrier) {
> + ret = blkdev_issue_flush(sb->s_bdev);
> + if (ret)
> + goto err_out;
> + }
[Severity: Medium]
Does this change break filesystem initialization for users who mount with
the nobarrier option on devices with broken write caches?
In ext4_run_li_request() in fs/ext4/super.c, the lazyinit thread calls
ext4_init_inode_table() with the barrier argument set unconditionally
to 1 for the first block group, ignoring the mount options:
ret = ext4_init_inode_table(sb, group,
elr->lr_timeout ? 0 : 1);
If a user mounts with -o nobarrier because their block device returns errors
for flush requests, this timing measurement flush will fail. Before this
patch, the flush error was safely ignored.
Now that the return value is checked, will this cause the lazy inode table
initialization thread to permanently abort and leave the inode tables
un-zeroed across mounts?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013062618.1741670-1-guolingxing@tju.edu.cn?part=1
next prev parent reply other threads:[~2026-10-13 6:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 6:26 [PATCH 1/3] ext4: check return value of blkdev_issue_flush() when initializing inode tables guolingxing
2026-10-13 6:26 ` [PATCH 2/3] ext4: check return value of blkdev_issue_flush() when starting a fast commit guolingxing
2026-10-13 6:42 ` sashiko-bot
2026-10-13 6:26 ` [PATCH 3/3] ext4: check return value of blkdev_issue_flush() when replaying fast commits guolingxing
2026-10-13 6:36 ` sashiko-bot
2026-10-13 6:39 ` sashiko-bot [this message]
2026-10-13 8:23 ` [PATCH v2 0/2] ext4: check return value of blkdev_issue_flush() in unchecked call sites guolingxing
2026-10-13 8:23 ` [PATCH v2 1/2] ext4: check return value of blkdev_issue_flush() when initializing inode tables guolingxing
2026-10-13 8:39 ` sashiko-bot
2026-10-13 8:23 ` [PATCH v2 2/2] ext4: check return value of blkdev_issue_flush() when starting a fast commit guolingxing
2026-10-13 8:34 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-169116@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=guolingxing@tju.edu.cn \
--cc=linux-ext4@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.