aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2013-06-21 11:48:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-13 14:42:27 -0400
commitc334daca734bbb11f79742ec699b1cf9d2112117 (patch)
tree5afa46c98b2679da823b5206b561dfba0b8df296 /fs/nfsd/nfs4xdr.c
parent9c42c27677b133bd8c8f7a7d69dd4d00e96ef035 (diff)
nfsd4: fix decoding of compounds across page boundaries
commit 247500820ebd02ad87525db5d9b199e5b66f6636 upstream. A freebsd NFSv4.0 client was getting rare IO errors expanding a tarball. A network trace showed the server returning BAD_XDR on the final getattr of a getattr+write+getattr compound. The final getattr started on a page boundary. I believe the Linux client ignores errors on the post-write getattr, and that that's why we haven't seen this before. Reported-by: Rick Macklem <rmacklem@uoguelph.ca> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 6cd86e0fe450..582321a978b0 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -162,8 +162,8 @@ static __be32 *read_buf(struct nfsd4_compoundargs *argp, u32 nbytes)
162 */ 162 */
163 memcpy(p, argp->p, avail); 163 memcpy(p, argp->p, avail);
164 /* step to next page */ 164 /* step to next page */
165 argp->p = page_address(argp->pagelist[0]);
166 argp->pagelist++; 165 argp->pagelist++;
166 argp->p = page_address(argp->pagelist[0]);
167 if (argp->pagelen < PAGE_SIZE) { 167 if (argp->pagelen < PAGE_SIZE) {
168 argp->end = argp->p + (argp->pagelen>>2); 168 argp->end = argp->p + (argp->pagelen>>2);
169 argp->pagelen = 0; 169 argp->pagelen = 0;