]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NFS: Fix the XDR iovec calculation in nfs3_xdr_setaclargs
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 21 Apr 2009 21:20:08 +0000 (21:20 +0000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:37:05 +0000 (10:37 -0700)
upstream commit: 8340437210390676f687633a80e3748c40885dc8

Commit ae46141ff08f1965b17c531b571953c39ce8b9e2 (NFSv3: Fix posix ACL code)
introduces a bug in the calculation of the XDR header iovec. In the case
where we are inlining the acls, we need to adjust the length of the iovec
req->rq_svec, in addition to adjusting the total buffer length.

Tested-by: Leonardo Chiquitto <leonardo.lists@gmail.com>
Tested-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
fs/nfs/nfs3xdr.c

index 6cdeacffde469143045588c6b20e6cff72cc586a..4bd49c1358cd69b517533d90540566d1647d9421 100644 (file)
@@ -716,7 +716,8 @@ nfs3_xdr_setaclargs(struct rpc_rqst *req, __be32 *p,
        if (args->npages != 0)
                xdr_encode_pages(buf, args->pages, 0, args->len);
        else
-               req->rq_slen += args->len;
+               req->rq_slen = xdr_adjust_iovec(req->rq_svec,
+                               p + XDR_QUADLEN(args->len));
 
        err = nfsacl_encode(buf, base, args->inode,
                            (args->mask & NFS_ACL) ?