linux/fs/jbd2
Zhang Yi a71e465f69 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>
History 2025-01-17 13:36:09 +01:00
..
checkpoint.c jbd2: stop waiting for space when jbd2_cleanup_journal_tail() returns error 2024-10-10 11:57:50 +02:00
commit.c jbd2: flush filesystem device before updating tail sequence 2025-01-17 13:36:09 +01:00
journal.c jbd2: correctly compare tids with tid_geq function in jbd2_fc_begin_commit 2024-10-10 11:57:50 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
recovery.c jbd2: avoid mount failed when commit block is partial submitted 2024-09-12 11:11:37 +02:00
revoke.c jbd2: increase IO priority for writing revoke records 2025-01-17 13:36:09 +01:00
transaction.c jbd2: avoid infinite transaction commit loop 2024-08-03 08:54:19 +02:00