diff options
author | Lukas Czerner <lczerner@redhat.com> | 2022-08-24 19:03:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-10-26 14:25:13 +0300 |
commit | 0e1764ad71abca735418fd596a82067074b59687 (patch) | |
tree | 59598e98c1a5ebad685ad38026b38aa0ab6b4c4a /fs | |
parent | 483831ad0440f62c10d1707c97ce824bd82d98ae (diff) | |
download | linux-0e1764ad71abca735418fd596a82067074b59687.tar.xz |
ext4: don't increase iversion counter for ea_inodes
commit 50f094a5580e6297bf10a807d16f0ee23fa576cf 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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/inode.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 44b6d061ed71..867c4d52bb78 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5769,7 +5769,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 */ |