linux-stable/fs/nfs
Kinglong Mee 14e7316a3c nfs: fix redundant readdir request after get eof
When a directory contains 17 files (except . and ..), nfs client sends
a redundant readdir request after get eof.

A simple reproduce,
At NFS server, create a directory with 17 files under exported directory.
 # mkdir test
 # cd test
 # for i in {0..16}  ; do touch $i; done

At NFS client, no matter mounting through nfsv3 or nfsv4,
does ls (or ll) at the created test directory.

A tshark output likes following (for nfsv4),

 # tshark -i eth0 tcp port 2049 -Tfields -e ip.src -e ip.dst -e nfs -e nfs.cookie4

srcip   dstip   SEQUENCE, PUTFH, READDIR        0
dstip   srcip   SEQUENCE PUTFH READDIR  909539109313539306,2108391201987888856,2305312124304486544,2566335452463141496,2978225129081509984,4263037479923412583,4304697173036510679,4666703455469210097,4759208201298769007,4776701232145978803,5338408478512081262,5949498658935544804,5971526429894832903,6294060338267709855,6528840566229532529,8600463293536422524,9223372036854775807
srcip   dstip
srcip   dstip   SEQUENCE, PUTFH, READDIR        9223372036854775807
dstip   srcip   SEQUENCE PUTFH READDIR

The READDIR with cookie 9223372036854775807(0x7FFFFFFFFFFFFFFF) is redundant.

Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2023-08-24 13:24:15 -04:00
..
blocklayout nfs/blocklayout: Use the passed in gfp flags 2023-08-24 13:24:15 -04:00
filelayout pNFS/filelayout: treat GETDEVICEINFO errors as layout failure 2023-02-15 11:07:54 -05:00
flexfilelayout
cache_lib.c
cache_lib.h
callback.c
callback.h
callback_proc.c
callback_xdr.c SUNRPC: Use per-CPU counters to tally server RPC counts 2023-02-20 09:20:32 -05:00
client.c NFS: Don't cleanup sysfs superblock entry if uninitialized 2023-06-29 14:25:35 -04:00
delegation.c
delegation.h
dir.c nfs: fix redundant readdir request after get eof 2023-08-24 13:24:15 -04:00
direct.c NFS: Fix a use after free in nfs_direct_join_group() 2023-08-17 09:30:38 -04:00
dns_resolve.c NFS: Move common includes outside ifdef 2023-08-24 13:24:15 -04:00
dns_resolve.h
export.c nfsd: allow reaping files still under writeback 2023-04-26 09:04:59 -04:00
file.c filemap: Fix errors in file.c 2023-08-24 13:24:15 -04:00
fs_context.c NFS: Add an "xprtsec=" NFS mount option 2023-06-19 12:30:17 -04:00
fscache.c NFS: set varaiable nfs_netfs_debug_id storage-class-specifier to static 2023-04-21 16:36:21 -04:00
fscache.h NFS: Convert buffered read paths to use netfs when fscache is enabled 2023-04-11 13:08:26 -04:00
getroot.c
inode.c nfs: don't report STATX_BTIME in ->getattr 2023-06-19 17:16:43 -04:00
internal.h NFSv4.2: Rework scratch handling for READ_PLUS (again) 2023-08-23 15:58:47 -04:00
io.c
iostat.h NFS: Remove all NFSIOS_FSCACHE counters due to conversion to netfs API 2023-04-11 13:08:26 -04:00
Kconfig NFS: Enable the READ_PLUS operation by default 2023-08-23 15:58:47 -04:00
Makefile
mount_clnt.c
namespace.c fs: port ->getattr() to pass mnt_idmap 2023-01-19 09:24:25 +01:00
netns.h
nfs.h
nfs2super.c
nfs2xdr.c
nfs3_fs.h fs: drop unused posix acl handlers 2023-03-06 09:57:12 +01:00
nfs3acl.c Mainly singleton patches all over the place. Series of note are: 2023-04-27 19:57:00 -07:00
nfs3client.c NFS: add a sysfs link to the acl rpc_client 2023-06-19 15:06:40 -04:00
nfs3proc.c
nfs3super.c fs: drop unused posix acl handlers 2023-03-06 09:57:12 +01:00
nfs3xdr.c
nfs4_fs.h filelock: move file locking definitions to separate header file 2023-01-11 06:52:32 -05:00
nfs4client.c NFS: Add sysfs links to sunrpc clients for nfs_clients 2023-06-19 15:04:13 -04:00
nfs4file.c nfs: Provide a splice-read wrapper 2023-05-24 08:42:16 -06:00
nfs4getroot.c
nfs4idmap.c
nfs4idmap.h
nfs4namespace.c
nfs4proc.c NFSv4.2: Rework scratch handling for READ_PLUS (again) 2023-08-23 15:58:47 -04:00
nfs4renewd.c
nfs4session.c
nfs4session.h
nfs4state.c NFSv4: Clean up some shutdown loops 2023-06-19 15:09:25 -04:00
nfs4super.c
nfs4sysctl.c nfs: simplify two-level sysctl registration for nfs4_cb_sysctls 2023-04-13 11:49:35 -07:00
nfs4trace.c
nfs4trace.h nfs4trace: fix state manager flag printing 2023-02-14 15:43:57 -05:00
nfs4xdr.c
nfs42.h NFSv4.2: Rework scratch handling for READ_PLUS (again) 2023-08-23 15:58:47 -04:00
nfs42proc.c NFSv4.2: fix error handling in nfs42_proc_getxattr 2023-08-19 10:26:29 -04:00
nfs42xattr.c NFSv4.2: fix wrong shrinker_id 2023-06-19 15:10:45 -04:00
nfs42xdr.c NFSv4.2: Rework scratch handling for READ_PLUS (again) 2023-08-23 15:58:47 -04:00
nfsroot.c NFS: Prefer strscpy over strlcpy calls 2023-05-22 12:34:41 -07:00
nfstrace.c
nfstrace.h NFS: Remove fscache specific trace points and NFS_INO_FSCACHE bit 2023-04-11 13:08:27 -04:00
pagelist.c NFS: Convert buffered read paths to use netfs when fscache is enabled 2023-04-11 13:08:26 -04:00
pnfs.c pNFS/filelayout: treat GETDEVICEINFO errors as layout failure 2023-02-15 11:07:54 -05:00
pnfs.h NFS: Convert buffered writes to use folios 2023-02-14 14:22:32 -05:00
pnfs_dev.c NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info 2023-08-24 13:24:15 -04:00
pnfs_nfs.c NFS: Convert buffered writes to use folios 2023-02-14 14:22:32 -05:00
proc.c
read.c NFSv4.2: Rework scratch handling for READ_PLUS (again) 2023-08-23 15:58:47 -04:00
super.c NFS: add superblock sysfs entries 2023-06-19 15:03:48 -04:00
symlink.c
sysctl.c nfs: simplify two-level sysctl registration for nfs_cb_sysctls 2023-04-13 11:49:35 -07:00
sysfs.c NFS: Fix sysfs server name memory leak 2023-08-19 10:26:29 -04:00
sysfs.h NFS: Add sysfs links to sunrpc clients for nfs_clients 2023-06-19 15:04:13 -04:00
unlink.c
write.c - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00