diff mbox series

[RFC,v4,5/8] ext4: ext4_fc_track_inode() bug fix

Message ID 20220721060246.1696852-6-harshadshirwadkar@gmail.com
State Under Review
Delegated to: Theodore Ts'o
Headers show
Series Ext4 fast commit performance patch series | expand

Commit Message

harshad shirwadkar July 21, 2022, 6:02 a.m. UTC
This patch fixes a bug in ext4_fc_track_inode() where we should not
immediately return from ext4_fc_track_inode() if the inode is on fast
commit list. It is possible that the inode is on fast commit list and
then somebody calls ext4_fc_track_inode(). If we immediately return if
the inode is on fc list, we will let the caller modify the inode while
it is being committed.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
 fs/ext4/fast_commit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series


diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index 608ae16afcd6..0307e21e5b29 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -611,8 +611,7 @@  void ext4_fc_track_inode(handle_t *handle, struct inode *inode)
 	if (!test_opt2(inode->i_sb, JOURNAL_FAST_COMMIT) ||
 	    (EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY) ||
-		ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_INELIGIBLE) ||
-		!list_empty(&ei->i_fc_list))
+	    ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_INELIGIBLE))
 	while (ext4_test_inode_state(inode, EXT4_STATE_FC_COMMITTING)) {