Thread (2 messages) 2 messages, 1 author, 2011-07-27
DORMANTno replies

[PATCH 3/3] nfsd: vfs_llseek() with O_32BITHASH or O_64BITHASH

From: Bernd Schubert <hidden>
Date: 2011-07-27 11:03:01
Also in: linux-fsdevel, linux-nfs
Subsystem: filesystems (vfs and infrastructure), kernel nfsd, sunrpc, and lockd servers, the rest · Maintainers: Alexander Viro, Christian Brauner, Chuck Lever, Jeff Layton, Linus Torvalds

Use 32-bit or 64-bit llseek() hashes for directory offsets depending on
the NFS version. NFSv2 gets 32-bit hashes only.

Signed-off-by: Bernd Schubert <redacted>
---
 fs/nfsd/vfs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index fd0acca..d79bbcd 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1994,6 +1994,12 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp,
 	if (err)
 		goto out;
 
+	/* NFSv2 only supports 32 bit cookies */
+	if (rqstp->rq_vers > 2)
+		file->f_flags &= O_64BITHASH;
+	else
+		file->f_flags &= O_32BITHASH;
+
 	offset = vfs_llseek(file, offset, 0);
 	if (offset < 0) {
 		err = nfserrno((int)offset);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help