[PATCH 3/3] ext4: check return value of blkdev_issue_flush() when replaying fast commits
From: guolingxing
Date: Tue Oct 13 2026 - 02:32:18 EST
ext4_fc_replay_inode() writes the replayed inode to disk and then
issues a cache flush, but the return value is ignored. If the cache
flush fails, the fast commit replay continues and the mount may
succeed, even though the replayed inode contents are not guaranteed to
be on stable storage yet.
Check the return value of blkdev_issue_flush() and abort the fast
commit replay if the cache flush fails, like any other error detected
while replaying the inode. This causes the mount to fail instead of
silently succeeding with potentially unreplayed data.
Fixes: 8016e29f4362e ("ext4: fast commit recovery path")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: guolingxing <guolingxing@xxxxxxxxxx>
---
fs/ext4/fast_commit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index ead8b16f9be0..f554405ebabf 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);
return ret;
}
--
2.34.1