diff mbox

[2/2] nfsd4: fix xdr4 count of server in fs_location4

Message ID 20141209173710.GM20526@fieldses.org (mailing list archive)
State New, archived
Headers show

Commit Message

J. Bruce Fields Dec. 9, 2014, 5:37 p.m. UTC
On Sun, Dec 07, 2014 at 04:05:48PM -0500, Benjamin Coddington wrote:
> Fix a bug where nfsd4_encode_components_esc() incorrectly calculates the
> length of server array in fs_location4.

Thanks, applying as follows.

This is something I don't test regularly but should.

--b.

commit 3e376626896b
Author: Benjamin Coddington <bcodding@redhat.com>
Date:   Sun Dec 7 16:05:48 2014 -0500

    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: 082d4bd72a45 (nfsd4: "backfill" using write_bytes_to_xdr_buf)
    Cc: stable@vger.kernel.org
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index a8549f8fef57..e578c87d5527 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1817,7 +1817,7 @@  static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep,
 
 		str = end;
 	}
-	pathlen = htonl(xdr->buf->len - pathlen_offset);
+	pathlen = htonl(count);
 	write_bytes_to_xdr_buf(xdr->buf, pathlen_offset, &pathlen, 4);
 	return 0;
 }