All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: guolingxing <guolingxing@tju.edu.cn>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH 3/3] ext4: check return value of blkdev_issue_flush() when replaying fast commits
Date: Tue, 13 Oct 2026 06:36:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-169109@kernel.org> (raw)
In-Reply-To: <20261013062618.1741670-3-guolingxing@tju.edu.cn>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] ext4: regression causing mount failures on devices lacking flush support
- [Medium] ext4: severe mount delay due to O(N) per-inode fast commit cache flush
--

commit 1d9ac3ed6ced15861bdc5e6964915fbce6a1b1e6
Author: guolingxing <guolingxing@tju.edu.cn>

ext4: check return value of blkdev_issue_flush() when replaying fast commits

This patch updates ext4_fc_replay_inode() to check and return the error
code from blkdev_issue_flush(). It intends to abort the fast commit replay
and fail the mount if the cache flush fails.

Cc: stable@vger.kernel.org

> diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> index ead8b16f9be07..f554405ebabfe 100644
> --- a/fs/ext4/fast_commit.c
> +++ b/fs/ext4/fast_commit.c
> @@ -2019,7 +2019,7 @@ static int ext4_fc_replay_inode(struct super_block *sb,
>  out:
>  	iput(inode);
>  	if (!ret)
> -		blkdev_issue_flush(sb->s_bdev);
> +		ret = blkdev_issue_flush(sb->s_bdev);

[Severity: High]
Does this code introduce a regression for devices that do not support cache
flushes?

If the underlying block device (such as certain loop devices, ramdisks,
or older flash media) does not support flushes, blkdev_issue_flush() will
return -EOPNOTSUPP. Ext4 usually ignores -EOPNOTSUPP for flushes, but this
change unconditionally captures and returns the error code to the fast
commit replay mechanism.

As a result, fast commit replay will abort and the entire filesystem mount
will fail on these devices.

[Severity: Medium]
Can this flush cause severe mount delays during fast commit recovery?

Because ext4_fc_replay_inode() is called for every inode in the fast commit
journal, this will trigger an O(N) number of full device cache flushes.
This can cause significant performance degradation when processing a journal
with many EXT4_FC_TAG_INODE tags.

Additionally, is this flush structurally redundant? JBD2 already guarantees
a final blkdev_issue_flush() on the filesystem device (journal->j_fs_dev)
in jbd2_journal_recover() after all recovery passes (including fast commit
replay) are complete:

fs/jbd2/recovery.c:jbd2_journal_recover() {
    ...
    /* Make sure all replayed data is on permanent storage */
    if (journal->j_flags & JBD2_BARRIER) {
        err2 = blkdev_issue_flush(journal->j_fs_dev);
        if (!err)
            err = err2;
    }
    ...
}

>  
>  	return ret;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261013062618.1741670-1-guolingxing@tju.edu.cn?part=3

  reply	other threads:[~2026-10-13  6:36 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 [this message]
2026-10-13  6:39 ` [PATCH 1/3] ext4: check return value of blkdev_issue_flush() when initializing inode tables sashiko-bot
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-169109@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.