Patchwork [2/3] Remove check for a 32-bit cookie in nfsd4_readdir()

login
register
mail settings
Submitter Bernd Schubert
Date July 27, 2011, 11:02 a.m.
Message ID <20110727110254.204979.34074.stgit@localhost.localdomain>
Download mbox | patch
Permalink /patch/107029/
State New
Headers show

Comments

Bernd Schubert - July 27, 2011, 11:02 a.m.
Fan Yong <yong.fan@whamcloud.com>  noticed simply setting
O_64BITHASH wouldn't work with nfsd v4, as
nfsd4_readdir() checks for a 32 bit cookie. However, according to RFC 3530
cookies have a 64 bit type and it is also defined as u64
'struct nfsd4_readdir'.
So remove the test for >32-bit values.

Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
---
 fs/nfsd/nfs4proc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 3a6dbd7..f7799d3 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -682,7 +682,7 @@  nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	readdir->rd_bmval[1] &= nfsd_suppattrs1(cstate->minorversion);
 	readdir->rd_bmval[2] &= nfsd_suppattrs2(cstate->minorversion);
 
-	if ((cookie > ~(u32)0) || (cookie == 1) || (cookie == 2) ||
+	if ((cookie == 1) || (cookie == 2) ||
 	    (cookie == 0 && memcmp(readdir->rd_verf.data, zeroverf.data, NFS4_VERIFIER_SIZE)))
 		return nfserr_bad_cookie;