Skip to content

Commit

Permalink
ext4: don't increase iversion counter for ea_inodes
Browse files Browse the repository at this point in the history
commit 50f094a upstream.

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 <lczerner@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Link: https://lore.kernel.org/r/20220824160349.39664-1-lczerner@redhat.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Lukas Czerner authored and gregkh committed Oct 26, 2022
1 parent dd36629 commit 1f5e643
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/ext4/inode.c
Expand Up @@ -5701,7 +5701,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 */
Expand Down

0 comments on commit 1f5e643

Please sign in to comment.