Skip to content

Commit 08489c4

Browse files
Christoph Hellwigbrauner
authored andcommitted
xfs: enable non-blocking timestamp updates
The lazytime path using the generic helpers can never block in XFS because there is no ->dirty_inode method that could block. Allow non-blocking timestamp updates for this case by replacing generic_update_time with the open coded version without the S_NOWAIT check. Fixes: 66fa3ce ("fs: Add async write file modification handling.") Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260108141934.2052404-12-hch@lst.de Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent f92f8ed commit 08489c4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

fs/xfs/xfs_iops.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,16 +1195,22 @@ xfs_vn_update_time(
11951195

11961196
trace_xfs_update_time(ip);
11971197

1198-
if (flags & IOCB_NOWAIT)
1199-
return -EAGAIN;
1200-
12011198
if (inode->i_sb->s_flags & SB_LAZYTIME) {
1202-
if (type == FS_UPD_ATIME ||
1203-
!inode_maybe_inc_iversion(inode, false))
1204-
return generic_update_time(inode, type, flags);
1199+
int dirty;
1200+
1201+
dirty = inode_update_time(inode, type, flags);
1202+
if (dirty <= 0)
1203+
return dirty;
1204+
if (dirty == I_DIRTY_TIME) {
1205+
__mark_inode_dirty(inode, I_DIRTY_TIME);
1206+
return 0;
1207+
}
12051208

12061209
/* Capture the iversion update that just occurred */
12071210
log_flags |= XFS_ILOG_CORE;
1211+
} else {
1212+
if (flags & IOCB_NOWAIT)
1213+
return -EAGAIN;
12081214
}
12091215

12101216
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);

0 commit comments

Comments
 (0)