summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2020-06-04 22:20:06 +0200
committerTrond Myklebust <trond.myklebust@hammerspace.com>2020-07-13 05:49:55 +0200
commitac7cbb221159efbf4491de0177b4e20a5d62e5ae (patch)
treec9bb8ecdb836ae85df224d97d74fb2039237a65a /fs/nfs
parentLinux 5.8-rc5 (diff)
downloadlinux-ac7cbb221159efbf4491de0177b4e20a5d62e5ae.tar.xz
linux-ac7cbb221159efbf4491de0177b4e20a5d62e5ae.zip
NFS: Allow applications to speed up readdir+statx() using AT_STATX_DONT_SYNC
If the application uses the AT_STATX_DONT_SYNC flag after doing readdir(), then we should still mark the parent inode as seeing a readdirplus hit. That ensures that we continue to use readdirplus in the 'ls -l' type of workflow to do fast lookups of the dentries. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 0bf1f835de01..90f77fd0d1ca 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -794,8 +794,10 @@ int nfs_getattr(const struct path *path, struct kstat *stat,
trace_nfs_getattr_enter(inode);
- if ((query_flags & AT_STATX_DONT_SYNC) && !force_sync)
+ if ((query_flags & AT_STATX_DONT_SYNC) && !force_sync) {
+ nfs_readdirplus_parent_cache_hit(path->dentry);
goto out_no_update;
+ }
/* Flush out writes to the server in order to update c/mtime. */
if ((request_mask & (STATX_CTIME|STATX_MTIME)) &&