]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ext2: Fix lost inode updates for IS_SYNC inodes
authorJan Kara <jack@suse.cz>
Mon, 27 Jul 2026 10:49:24 +0000 (12:49 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 27 Jul 2026 14:25:32 +0000 (16:25 +0200)
commit356984d1a5c32e94810cbb6c8dc7d8ff2d4d919a
treeb71402be20a114f8fa5805dbf45b891dfc5d998d
parentc474bc56b6d147b40b96cfed6a30d8302cef0a33
ext2: Fix lost inode updates for IS_SYNC inodes

ext2_setsize() and ext2_xattr_set2() had a construct like:

if (IS_SYNC(inode)) {
sync_inode_metadata(inode, 1);
} else {
mark_inode_dirty(inode);
}

which leads to lost inode updates for IS_SYNC inodes because
sync_inode_metadata() does anything only if the inode is already dirty
and hence inode updates may be simply lost. Fix the problem by
unconditionally marking the inode dirty and *then* call
sync_inode_metadata().

CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260727104923.3828017-26-jack@suse.cz
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/ext2/inode.c
fs/ext2/xattr.c