Skip to content

Commit bf7491f

Browse files
bcodding-rhJ. Bruce Fields
authored andcommitted
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: Benjamin Coddington <bcodding@redhat.com> Fixes: 082d4bd (nfsd4: "backfill" using write_bytes_to_xdr_buf) Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 5a64e56 commit bf7491f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep,
18171817

18181818
str = end;
18191819
}
1820-
pathlen = htonl(xdr->buf->len - pathlen_offset);
1820+
pathlen = htonl(count);
18211821
write_bytes_to_xdr_buf(xdr->buf, pathlen_offset, &pathlen, 4);
18221822
return 0;
18231823
}

0 commit comments

Comments
 (0)