The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] ext4: use ext4_update_inode_fsync_trans() helper in inode creation
@ 2024-05-27 16:14 Luis Henriques (SUSE)
  2024-07-11  2:35 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Henriques (SUSE) @ 2024-05-27 16:14 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger
  Cc: linux-ext4, linux-kernel, 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().

Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
---
 fs/ext4/ialloc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index e9bbb1da2d0a..9dfd768ed9f8 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -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) {

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

end of thread, other threads:[~2024-07-11  2:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-27 16:14 [PATCH] ext4: use ext4_update_inode_fsync_trans() helper in inode creation Luis Henriques (SUSE)
2024-07-11  2:35 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox