From patchwork Sun Jul 31 00:52:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Rees X-Patchwork-Id: 1023292 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6V0r913005920 for ; Sun, 31 Jul 2011 00:53:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203Ab1GaAxL (ORCPT ); Sat, 30 Jul 2011 20:53:11 -0400 Received: from merit-proxy01.merit.edu ([207.75.116.193]:38050 "EHLO merit-proxy01.merit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752156Ab1GaAxH (ORCPT ); Sat, 30 Jul 2011 20:53:07 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by merit-proxy01.merit.edu (Postfix) with ESMTP id 24D1F2039875; Sat, 30 Jul 2011 20:53:07 -0400 (EDT) X-Virus-Scanned: amavisd-new at merit-proxy01.merit.edu Received: from merit-proxy01.merit.edu ([127.0.0.1]) by localhost (merit-proxy01.merit.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N0gSBxC5r6FD; Sat, 30 Jul 2011 20:53:03 -0400 (EDT) Received: from merit.edu (74-126-0-171.static.123.net [74.126.0.171]) by merit-proxy01.merit.edu (Postfix) with ESMTPSA id D83662039B14; Sat, 30 Jul 2011 20:53:02 -0400 (EDT) From: Jim Rees To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, peter honeyman Subject: [PATCH v7 04/26] pnfs: use lwb as layoutcommit length Date: Sat, 30 Jul 2011 20:52:34 -0400 Message-Id: <1312073576-11024-5-git-send-email-rees@umich.edu> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1312073576-11024-1-git-send-email-rees@umich.edu> References: <1312073576-11024-1-git-send-email-rees@umich.edu> 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.6 (demeter1.kernel.org [140.211.167.41]); Sun, 31 Jul 2011 00:53:12 +0000 (UTC) From: Peng Tao Using NFS4_MAX_UINT64 will break current protocol. [Needed in v3.0] CC: Stable Tree Signed-off-by: Peng Tao Signed-off-by: Jim Rees --- fs/nfs/nfs4xdr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index c191a9b..b851b56 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -1916,7 +1916,7 @@ encode_layoutcommit(struct xdr_stream *xdr, *p++ = cpu_to_be32(OP_LAYOUTCOMMIT); /* Only whole file layouts */ p = xdr_encode_hyper(p, 0); /* offset */ - p = xdr_encode_hyper(p, NFS4_MAX_UINT64); /* length */ + p = xdr_encode_hyper(p, args->lastbytewritten + 1); /* length */ *p++ = cpu_to_be32(0); /* reclaim */ p = xdr_encode_opaque_fixed(p, args->stateid.data, NFS4_STATEID_SIZE); *p++ = cpu_to_be32(1); /* newoffset = TRUE */