From patchwork Wed Nov 17 18:00:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 333751 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAHI10nN000517 for ; Wed, 17 Nov 2010 18:01:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935209Ab0KQSAk (ORCPT ); Wed, 17 Nov 2010 13:00:40 -0500 Received: from mail-iw0-f174.google.com ([209.85.214.174]:52633 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935208Ab0KQSAj (ORCPT ); Wed, 17 Nov 2010 13:00:39 -0500 Received: by mail-iw0-f174.google.com with SMTP id 35so2387538iwn.19 for ; Wed, 17 Nov 2010 10:00:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:subject:to:cc :date:message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=tg1TwFmfvb5nX52JHgHyKAzGqD9Gmu3LtK9t5VpGIew=; b=Afwz6r3w2h9u3HdnevSbzMTEAmq+YZTBrptkfa5WAAtuJKBBf88FZmousYIgQFud6j aWzdpXqONzlgdH1E0VY+G344flC77TMhpyFVGRbCNjdHREiiHfryGvE8gS+Ik+bZfbn9 HivcMbk2LgxoMUe5FFrxhKlNtYhWg9wPhCp9o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=SaNM44+kCCiSoalDMEP9VSuiEoXI7kFcGz5HsoOeazVrRngOEYAoOx+Wkx7AvlHdqb nzBunNPNIhy56+X9SlXHRsw/I+Muz1EUykNSRvOUPm78gL/rciA+DRWs+39RPJE2nRdc bK0uWQWLYbp1bsOQ+e7UYEvhLRtLpioUiaANM= Received: by 10.231.159.146 with SMTP id j18mr7667217ibx.77.1290016837917; Wed, 17 Nov 2010 10:00:37 -0800 (PST) Received: from matisse.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net [99.26.161.222]) by mx.google.com with ESMTPS id 8sm2434978iba.4.2010.11.17.10.00.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Nov 2010 10:00:37 -0800 (PST) From: Chuck Lever Subject: [PATCH 05/12] NFS: Fix hdrlen calculation in NFSv4's decode_read() To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Wed, 17 Nov 2010 13:00:34 -0500 Message-ID: <20101117180034.29429.60575.stgit@matisse.1015granger.net> In-Reply-To: <20101117175317.29429.90956.stgit@matisse.1015granger.net> References: <20101117175317.29429.90956.stgit@matisse.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 17 Nov 2010 18:01:00 +0000 (UTC) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 53168f6..af30a5f 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: "