aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs3proc.c16
-rw-r--r--fs/nfsd/nfs3xdr.c1
2 files changed, 15 insertions, 2 deletions
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index 9eb8086ea841..c9cf46e0c040 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -463,8 +463,19 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp)
463 &resp->common, nfs3svc_encode_entry); 463 &resp->common, nfs3svc_encode_entry);
464 memcpy(resp->verf, argp->verf, 8); 464 memcpy(resp->verf, argp->verf, 8);
465 resp->count = resp->buffer - argp->buffer; 465 resp->count = resp->buffer - argp->buffer;
466 if (resp->offset) 466 if (resp->offset) {
467 xdr_encode_hyper(resp->offset, argp->cookie); 467 loff_t offset = argp->cookie;
468
469 if (unlikely(resp->offset1)) {
470 /* we ended up with offset on a page boundary */
471 *resp->offset = htonl(offset >> 32);
472 *resp->offset1 = htonl(offset & 0xffffffff);
473 resp->offset1 = NULL;
474 } else {
475 xdr_encode_hyper(resp->offset, offset);
476 }
477 resp->offset = NULL;
478 }
468 479
469 RETURN_STATUS(nfserr); 480 RETURN_STATUS(nfserr);
470} 481}
@@ -533,6 +544,7 @@ nfsd3_proc_readdirplus(struct svc_rqst *rqstp)
533 } else { 544 } else {
534 xdr_encode_hyper(resp->offset, offset); 545 xdr_encode_hyper(resp->offset, offset);
535 } 546 }
547 resp->offset = NULL;
536 } 548 }
537 549
538 RETURN_STATUS(nfserr); 550 RETURN_STATUS(nfserr);
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 9b973f4f7d01..83919116d5cb 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -921,6 +921,7 @@ encode_entry(struct readdir_cd *ccd, const char *name, int namlen,
921 } else { 921 } else {
922 xdr_encode_hyper(cd->offset, offset64); 922 xdr_encode_hyper(cd->offset, offset64);
923 } 923 }
924 cd->offset = NULL;
924 } 925 }
925 926
926 /* 927 /*