提交 bf7491f1 编写于 作者: B Benjamin Coddington 提交者: J. Bruce Fields

nfsd4: fix xdr4 count of server in fs_location4

Fix a bug where nfsd4_encode_components_esc() incorrectly calculates the
length of server array in fs_location4--note that it is a count of the
number of array elements, not a length in bytes.
Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
Fixes: 082d4bd7 (nfsd4: "backfill" using write_bytes_to_xdr_buf)
Cc: stable@vger.kernel.org
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 5a64e569
...@@ -1817,7 +1817,7 @@ static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep, ...@@ -1817,7 +1817,7 @@ static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep,
str = end; str = end;
} }
pathlen = htonl(xdr->buf->len - pathlen_offset); pathlen = htonl(count);
write_bytes_to_xdr_buf(xdr->buf, pathlen_offset, &pathlen, 4); write_bytes_to_xdr_buf(xdr->buf, pathlen_offset, &pathlen, 4);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册