Commit 82afc1e9 authored by Kendrick M. Smith's avatar Kendrick M. Smith Committed by Linus Torvalds

[PATCH] kNFSd: NFSv4: change ->rq_vers==3 to ->rq_vers>2

In a few places on the server, I had to change code that looked like:

   if (rqstp->rq_vers == 3)
       /* NFSv3 behavior */
   else
       /* NFSv2 behavior */

to:

   if (rqstp->rq_vers > 2)
       /* NFSv3 behavior */
   else
       /* NFSv2 behavior */

so that we would get the NFSv3 behavior, not the NFSv2 behavior,
in NFSv4.  This patch collects all changes of this type.
parent dc42d957
...@@ -107,7 +107,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) ...@@ -107,7 +107,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
int fsid = 0; int fsid = 0;
error = nfserr_stale; error = nfserr_stale;
if (rqstp->rq_vers == 3) if (rqstp->rq_vers > 2)
error = nfserr_badhandle; error = nfserr_badhandle;
if (fh->fh_version == 1) { if (fh->fh_version == 1) {
...@@ -171,7 +171,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) ...@@ -171,7 +171,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
* Look up the dentry using the NFS file handle. * Look up the dentry using the NFS file handle.
*/ */
error = nfserr_stale; error = nfserr_stale;
if (rqstp->rq_vers == 3) if (rqstp->rq_vers > 2)
error = nfserr_badhandle; error = nfserr_badhandle;
if (fh->fh_version != 1) { if (fh->fh_version != 1) {
......
...@@ -1401,7 +1401,7 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -1401,7 +1401,7 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
eof = !cd.eob; eof = !cd.eob;
if (cd.offset) { if (cd.offset) {
if (rqstp->rq_vers == 3) if (rqstp->rq_vers > 2)
(void)xdr_encode_hyper(cd.offset, file.f_pos); (void)xdr_encode_hyper(cd.offset, file.f_pos);
else else
*cd.offset = htonl(file.f_pos); *cd.offset = htonl(file.f_pos);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment