Commit 4f3cc480 authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

NFSv4: Fix brainfart in attribute length calculation

The calculation of the attribute length was 4 bytes off.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: default avatarAndre Heider <a.heider@gmail.com>
Reported-and-tested-by: default avatarHenrik Rydberg <rydberg@euromail.se>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b3a3a9c4
......@@ -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: */
......
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