Skip to contentSkip to conversation

ext4: use ext4_update_inode_fsync_trans() helper in inode creation

PATCH Applied Luis Henriques (SUSE) 2 participants 2 messages May 27, 2024 – Jul 11, 2024 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: use ext4_update_inode_fsync_trans() helper in inode creation

Call helper function ext4_update_inode_fsync_trans() instead of open coding it in __ext4_new_inode(). This helper checks both that the handle is valid *and* that it hasn't been aborted due to some fatal error in the journalling layer, using is_handle_aborted().

---
 fs/ext4/ialloc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/ext4/ialloc.c +1 -4
index e9bbb1da2d0a..9dfd768ed9f8 100644
@@ -1336,10 +1336,7 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap,
 		}
 	}
 
-	if (ext4_handle_valid(handle)) {
-		ei->i_sync_tid = handle->h_transaction->t_tid;
-		ei->i_datasync_tid = handle->h_transaction->t_tid;
-	}
+	ext4_update_inode_fsync_trans(handle, inode, 1);
 
 	err = ext4_mark_inode_dirty(handle, inode);
 	if (err) {
maintainer Applied
#1 lore raw
Quoted 6 lines · Luis Henriques (SUSE)

Call helper function ext4_update_inode_fsync_trans() instead of open coding it in __ext4_new_inode(). This helper checks both that the handle is valid *and* that it hasn't been aborted due to some fatal error in the journalling layer, using is_handle_aborted().

Applied, thanks!

[1/1] ext4: use ext4_update_inode_fsync_trans() helper in inode creation

      commit: 2d4d6bda0f7ba0f188a22698855a1397c8999df3

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>