]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
NFSv4: Fix brainfart in attribute length calculation
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 23 Jul 2013 16:53:39 +0000 (12:53 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 23 Jul 2013 21:24:59 +0000 (14:24 -0700)
The calculation of the attribute length was 4 bytes off.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: Andre Heider <a.heider@gmail.com>
Reported-and-tested-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nfs/nfs4xdr.c

index c74d6168db99b917ad202c874a9f161f29e920e5..3850b018815f2d07e4740fdd3ff8200523b9fe92 100644 (file)
@@ -1118,11 +1118,11 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap,
                                len, ((char *)p - (char *)q) + 4);
                BUG();
        }
-       len = (char *)p - (char *)q - (bmval_len << 2);
        *q++ = htonl(bmval0);
        *q++ = htonl(bmval1);
        if (bmval_len == 3)
                *q++ = htonl(bmval2);
+       len = (char *)p - (char *)(q + 1);
        *q = htonl(len);
 
 /* out: */