[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260106075008.1610195-12-hch@lst.de>
Date: Tue, 6 Jan 2026 08:50:05 +0100
From: Christoph Hellwig <hch@....de>
To: Christian Brauner <brauner@...nel.org>
Cc: Al Viro <viro@...iv.linux.org.uk>,
David Sterba <dsterba@...e.com>,
Jan Kara <jack@...e.cz>,
Mike Marshall <hubcap@...ibond.com>,
Martin Brandenburg <martin@...ibond.com>,
Carlos Maiolino <cem@...nel.org>,
Stefan Roesch <shr@...com>,
Jeff Layton <jlayton@...nel.org>,
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
Trond Myklebust <trondmy@...nel.org>,
Anna Schumaker <anna@...nel.org>,
linux-kernel@...r.kernel.org,
linux-btrfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
gfs2@...ts.linux.dev,
io-uring@...r.kernel.org,
devel@...ts.orangefs.org,
linux-unionfs@...r.kernel.org,
linux-mtd@...ts.infradead.org,
linux-xfs@...r.kernel.org,
linux-nfs@...r.kernel.org,
Chaitanya Kulkarni <kch@...dia.com>
Subject: [PATCH 11/11] 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: 66fa3cedf16a ("fs: Add async write file modification handling.")
Signed-off-by: Christoph Hellwig <hch@....de>
Reviewed-by: Chaitanya Kulkarni <kch@...dia.com>
Reviewed-by: Jeff Layton <jlayton@...nel.org>
---
fs/xfs/xfs_iops.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 338f3113f674..1cdd8a360510 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -1195,16 +1195,22 @@ xfs_vn_update_time(
trace_xfs_update_time(ip);
- if (flags & IOCB_NOWAIT)
- return -EAGAIN;
-
if (inode->i_sb->s_flags & SB_LAZYTIME) {
- if (type == FS_UPD_ATIME ||
- !inode_maybe_inc_iversion(inode, false))
- return generic_update_time(inode, type, flags);
+ int dirty;
+
+ dirty = inode_update_time(inode, type, flags);
+ if (dirty <= 0)
+ return dirty;
+ if (dirty == I_DIRTY_TIME) {
+ __mark_inode_dirty(inode, I_DIRTY_TIME);
+ return 0;
+ }
/* Capture the iversion update that just occurred */
log_flags |= XFS_ILOG_CORE;
+ } else {
+ if (flags & IOCB_NOWAIT)
+ return -EAGAIN;
}
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);
--
2.47.3
Powered by blists - more mailing lists