linux-stable/fs/jbd2
Zhang Yi 359abf6ca9 jbd2: flush filesystem device before updating tail sequence
[ Upstream commit a0851ea9cd ]

When committing transaction in jbd2_journal_commit_transaction(), the
disk caches for the filesystem device should be flushed before updating
the journal tail sequence. However, this step is missed if the journal
is not located on the filesystem device. As a result, the filesystem may
become inconsistent following a power failure or system crash. Fix it by
ensuring that the filesystem device is flushed appropriately.

Fixes: 3339578f05 ("jbd2: cleanup journal tail after transaction commit")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://lore.kernel.org/r/20241203014407.805916-3-yi.zhang@huaweicloud.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-02-01 18:22:17 +01:00
..
checkpoint.c jbd2: stop waiting for space when jbd2_cleanup_journal_tail() returns error 2024-10-17 15:08:21 +02:00
commit.c jbd2: flush filesystem device before updating tail sequence 2025-02-01 18:22:17 +01:00
journal.c jbd2: correctly compare tids with tid_geq function in jbd2_fc_begin_commit 2024-10-17 15:08:21 +02:00
Kconfig
Makefile
recovery.c
revoke.c
transaction.c