diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2008-10-30 13:48:33 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-10-30 17:16:49 -0400 |
commit | 8d7c4203c681a3ec359eccff4e53bc8c0ccf403b (patch) | |
tree | 78c848023b6fbefcd387602529c6e87039f4946e /fs/nfsd | |
parent | 0173a3265b228da319ceb9c1ec6a5682fd1b2d92 (diff) |
nfsd: fix failure to set eof in readdir in some situations
Before 14f7dd632011bb89c035722edd6ea0d90ca6b078 "[PATCH] Copy XFS
readdir hack into nfsd code", readdir_cd->err was reset to eof before
each call to vfs_readdir; afterwards, it is set only once. Similarly,
c002a6c7977320f95b5edede5ce4e0eeecf291ff "[PATCH] Optimise NFS readdir
hack slightly", can cause us to exit without nfserr_eof set. Fix this.
This ensures the "eof" bit is set when needed in readdir replies. (The
particular case I saw was an nfsv4 readdir of an empty directory, which
returned with no entries (the protocol requires "." and ".." to be
filtered out), but with eof unset.)
Cc: David Woodhouse <David.Woodhouse@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/vfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 0bc56f6d9276..848a03e83a42 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1912,6 +1912,7 @@ static int nfsd_buffered_readdir(struct file *file, filldir_t func, | |||
1912 | de = (struct buffered_dirent *)((char *)de + reclen); | 1912 | de = (struct buffered_dirent *)((char *)de + reclen); |
1913 | } | 1913 | } |
1914 | offset = vfs_llseek(file, 0, SEEK_CUR); | 1914 | offset = vfs_llseek(file, 0, SEEK_CUR); |
1915 | cdp->err = nfserr_eof; | ||
1915 | if (!buf.full) | 1916 | if (!buf.full) |
1916 | break; | 1917 | break; |
1917 | } | 1918 | } |