linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/3] ext4: don't increase iversion counter for ea_inodes
@ 2022-08-12 12:37 Lukas Czerner
  2022-08-12 12:37 ` [PATCH v3 2/3] fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE Lukas Czerner
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Lukas Czerner @ 2022-08-12 12:37 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, jlayton, jack, linux-fsdevel, ebiggers, david

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().

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
---
v2, v3: no change

 fs/ext4/inode.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 601214453c3a..2a220be34caa 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 */
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-08-22  8:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-12 12:37 [PATCH v3 1/3] ext4: don't increase iversion counter for ea_inodes Lukas Czerner
2022-08-12 12:37 ` [PATCH v3 2/3] fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE Lukas Czerner
2022-08-12 18:01   ` Eric Biggers
2022-08-12 18:12   ` Eric Biggers
2022-08-16 11:21     ` Jan Kara
2022-08-21  6:14       ` Christoph Hellwig
2022-08-22  8:33         ` Jan Kara
2022-08-12 18:42   ` Eric Biggers
2022-08-16 11:41     ` Jan Kara
2022-08-12 12:37 ` [PATCH v4 3/3] ext4: unconditionally enable the i_version counter Lukas Czerner
2022-08-12 13:05   ` Christian Brauner
2022-08-16 11:48   ` Jan Kara
2022-08-12 13:04 ` [PATCH v3 1/3] ext4: don't increase iversion counter for ea_inodes Christian Brauner
2022-08-12 18:42 ` Jeff Layton
2022-08-16 11:52   ` Jan Kara
2022-08-16 12:18     ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).