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 2/3] ext4: check return value of blkdev_issue_flush() when starting a fast commit
Date: Tue, 13 Oct 2026 06:42:02 +0000	[thread overview]
Message-ID: <sashiko-outbox-169121@kernel.org> (raw)
In-Reply-To: <20261013062618.1741670-2-guolingxing@tju.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ext4: missing JBD2_BARRIER check for fast commit device flush
--

commit a1cae98067fdb2cd8eec738283b6d33c84b7ca8d
Author: guolingxing <guolingxing@tju.edu.cn>

ext4: check return value of blkdev_issue_flush() when starting a fast commit

When the file system device differs from the journal device, a cache flush
is issued before fast commit blocks are written. The return value of
blkdev_issue_flush() was previously ignored. This patch checks the return
value and aborts the fast commit if the flush fails, falling back to a full
journal commit.

> diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> index 0cac890cf3702..ead8b16f9be07 100644
> --- a/fs/ext4/fast_commit.c
> +++ b/fs/ext4/fast_commit.c
> @@ -1425,8 +1425,11 @@ static int ext4_fc_perform_commit(journal_t *journal, tid_t commit_tid)
>  	 * Step 5: If file system device is different from journal device,
>  	 * issue a cache flush before we start writing fast commit blocks.
>  	 */
> -	if (journal->j_fs_dev != journal->j_dev)
> -		blkdev_issue_flush(journal->j_fs_dev);
> +	if (journal->j_fs_dev != journal->j_dev) {
> +		ret = blkdev_issue_flush(journal->j_fs_dev);
> +		if (ret)
> +			return ret;
> +	}

[Severity: Medium]
This problem wasn't introduced by this patch, but does this flush need to
validate journal->j_flags & JBD2_BARRIER before proceeding?

In ext4_fc_perform_commit(), blkdev_issue_flush() is called unconditionally
when the filesystem device differs from the journal device. If the filesystem
is mounted with the "nobarrier" option, this appears to ignore the mount
option and issue the cache flush anyway, unlike the JBD2 full commit path and
fast commit tail block writers.

Could this bypass the user's mount options and cause unnecessary I/O
overhead during fast commits?

>  
>  	blk_start_plug(&plug);
>  	alloc_ctx = ext4_fc_lock(sb);

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

  reply	other threads:[~2026-10-13  6:42 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 [this message]
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 ` [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-169121@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.