Thread (28 messages) 28 messages, 5 authors, 2023-09-10
STALE1001d
Revisions (2)
  1. v5 [diff vs current]
  2. v6 current

[PATCH 09/11] vfs: error out -EAGAIN if atime needs to be updated

From: Hao Xu <hidden>
Date: 2023-08-27 13:36:15
Also in: bpf, io-uring, linux-block, linux-btrfs, linux-cifs, linux-ext4, linux-f2fs-devel, linux-fsdevel, linux-mm, linux-nfs, linux-s390, linux-unionfs, linux-xfs, lkml
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

From: Hao Xu <redacted>

To enforce nowait semantics, error out -EAGAIN if atime needs to be
updated.

Signed-off-by: Hao Xu <redacted>
---
 fs/inode.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/fs/inode.c b/fs/inode.c
index e83b836f2d09..32d81be65cf9 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1970,6 +1970,9 @@ int touch_atime(const struct path *path, bool nowait)
 	if (!atime_needs_update(path, inode))
 		return 0;
 
+	if (nowait)
+		return -EAGAIN;
+
 	if (!sb_start_write_trylock(inode->i_sb))
 		return 0;
 
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help