diff mbox

[22/31] NFS: Fix hdrlen calculation in NFSv4's decode_read()

Message ID 20101214145801.2293.98571.stgit@matisse.1015granger.net
State Accepted, archived
Delegated to: Trond Myklebust
Headers show

Commit Message

Chuck Lever Dec. 14, 2010, 2:58 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index a48a43c..868815c 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -4475,7 +4475,7 @@  static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_
 		goto out_overflow;
 	eof = be32_to_cpup(p++);
 	count = be32_to_cpup(p);
-	hdrlen = (u8 *) p - (u8 *) iov->iov_base;
+	hdrlen = (u8 *) xdr->p - (u8 *) iov->iov_base;
 	recvd = req->rq_rcv_buf.len - hdrlen;
 	if (count > recvd) {
 		dprintk("NFS: server cheating in read reply: "