提交 4f3cc480 编写于 作者: T Trond Myklebust 提交者: Linus Torvalds

NFSv4: Fix brainfart in attribute length calculation

The calculation of the attribute length was 4 bytes off.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: NAndre Heider <a.heider@gmail.com>
Reported-and-tested-by: NHenrik Rydberg <rydberg@euromail.se>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册