Skip to content

Commit 2d4d6bd

Browse files
Luis Henriques (SUSE)tytso
authored andcommitted
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(). Signed-off-by: Luis Henriques (SUSE) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 7378e89 commit 2d4d6bd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fs/ext4/ialloc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,10 +1336,7 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap,
13361336
}
13371337
}
13381338

1339-
if (ext4_handle_valid(handle)) {
1340-
ei->i_sync_tid = handle->h_transaction->t_tid;
1341-
ei->i_datasync_tid = handle->h_transaction->t_tid;
1342-
}
1339+
ext4_update_inode_fsync_trans(handle, inode, 1);
13431340

13441341
err = ext4_mark_inode_dirty(handle, inode);
13451342
if (err) {

0 commit comments

Comments
 (0)