From: Lukas Czerner Date: Wed, 24 Aug 2022 16:03:47 +0000 (+0200) Subject: ext4: don't increase iversion counter for ea_inodes X-Git-Tag: v6.1-rc5~289^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50f094a5580e6297bf10a807d16f0ee23fa576cf;p=platform%2Fkernel%2Flinux-starfive.git ext4: don't increase iversion counter for ea_inodes ea_inodes are using i_version for storing part of the reference count so we really need to leave it alone. The problem can be reproduced by xfstest ext4/026 when iversion is enabled. Fix it by not calling inode_inc_iversion() for EXT4_EA_INODE_FL inodes in ext4_mark_iloc_dirty(). Cc: stable@kernel.org Signed-off-by: Lukas Czerner Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Reviewed-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20220824160349.39664-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 6012144..2a220be 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5731,7 +5731,12 @@ int ext4_mark_iloc_dirty(handle_t *handle, } ext4_fc_track_inode(handle, inode); - if (IS_I_VERSION(inode)) + /* + * ea_inodes are using i_version for storing reference count, don't + * mess with it + */ + if (IS_I_VERSION(inode) && + !(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)) inode_inc_iversion(inode); /* the do_update_inode consumes one bh->b_count */