]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ext4: Fix data integrity writeout issues in nojournal mode
authorJan Kara <jack@suse.cz>
Mon, 27 Jul 2026 10:49:35 +0000 (12:49 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 27 Jul 2026 14:25:33 +0000 (16:25 +0200)
commitc26339e1df335423bcbb83d6fa6ff94b1545b8ed
tree481c8081a42c922a3e621904c9347bb56eee122d
parent84af7c3b3462eeef41c4c44dcc41d0701e4e2143
ext4: Fix data integrity writeout issues in nojournal mode

Several racing fsyncs on ext4 in nojournal mode could result in some
fsync returning earlier than all metadata buffers were properly
persisted. Also ext4_fsync() in nojournal mode was somewhat inefficient
because it was always writing out the inode regardless whether it was
dirty or not.

Fix these issues by using new .sync_inode_metadata method which makes
sure all inode related metadata is written to disk during any
WB_SYNC_ALL writeback in nojournal mode. This also somewhat simplifies
the nojournal mode fsync handling.

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260727104923.3828017-37-jack@suse.cz
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/ext4/ext4.h
fs/ext4/fsync.c
fs/ext4/inode.c
fs/ext4/super.c