sst-linux/fs/jbd2
Zhang Yi 5af095cb86 jbd2: flush filesystem device before updating tail sequence
[ Upstream commit a0851ea9cd555c333795b85ddd908898b937c4e1 ]

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-01-17 13:34:37 +01:00
..
checkpoint.c jbd2: stop waiting for space when jbd2_cleanup_journal_tail() returns error 2024-10-17 15:21:56 +02:00
commit.c jbd2: flush filesystem device before updating tail sequence 2025-01-17 13:34:37 +01:00
journal.c jbd2: correctly compare tids with tid_geq function in jbd2_fc_begin_commit 2024-10-17 15:21:56 +02:00
Kconfig
Makefile
recovery.c jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev 2023-11-28 17:07:13 +00:00
revoke.c jbd2: increase IO priority for writing revoke records 2025-01-17 13:34:37 +01:00
transaction.c