From patchwork Thu Jul 28 17:30:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Rees X-Patchwork-Id: 1017172 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 p6SHUbHv006146 for ; Thu, 28 Jul 2011 17:31:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755829Ab1G1Rb1 (ORCPT ); Thu, 28 Jul 2011 13:31:27 -0400 Received: from merit-proxy02.merit.edu ([207.75.116.194]:42192 "EHLO merit-proxy02.merit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755605Ab1G1Rb0 (ORCPT ); Thu, 28 Jul 2011 13:31:26 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by merit-proxy02.merit.edu (Postfix) with ESMTP id 449A32039B1F; Thu, 28 Jul 2011 13:31:26 -0400 (EDT) X-Virus-Scanned: amavisd-new at merit-proxy02.merit.edu Received: from merit-proxy02.merit.edu ([127.0.0.1]) by localhost (merit-proxy02.merit.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GHsMnnc68YaB; Thu, 28 Jul 2011 13:31:25 -0400 (EDT) Received: from merit.edu (dhcp-12be.meeting.ietf.org [130.129.18.190]) by merit-proxy02.merit.edu (Postfix) with ESMTPSA id 9AFE82039854; Thu, 28 Jul 2011 13:31:25 -0400 (EDT) From: Jim Rees To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, peter honeyman Subject: [PATCH v4 06/27] pnfs: use lwb as layoutcommit length Date: Thu, 28 Jul 2011 13:30:55 -0400 Message-Id: <1311874276-1386-7-git-send-email-rees@umich.edu> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1311874276-1386-1-git-send-email-rees@umich.edu> References: <1311874276-1386-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]); Thu, 28 Jul 2011 17:31:48 +0000 (UTC) From: Peng Tao Using NFS4_MAX_UINT64 will break current protocol. Signed-off-by: Peng Tao --- 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 0a1a7b8..5f769f8 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -1955,7 +1955,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 */