From patchwork Thu May 19 21:34:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaliy Gusev X-Patchwork-Id: 800212 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 p4JLZgiT024415 for ; Thu, 19 May 2011 21:35:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932455Ab1ESVfK (ORCPT ); Thu, 19 May 2011 17:35:10 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:37914 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934614Ab1ESVfG (ORCPT ); Thu, 19 May 2011 17:35:06 -0400 Received: by bwz15 with SMTP id 15so2472238bwz.19 for ; Thu, 19 May 2011 14:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=oIKQ78f7PcBG7km7B0f00Xnm6hYo6e1mV2TORE/Gd0c=; b=vVPiysmDYnEl1pzqr9AwB+gmU4QIjakLXGglQbvEH4qd2HCruxnhNpbRUkZ37NtFLt zsSnko5uickUaWp0MAJaXTWlrNkBuvxgSfDDNzIXdCtDzRT1oC2w93+RMToxLTR6CS9t 8RzFoxoYP9gyUrwlocaDPgCaukYPlQIxZNltY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=E3PVRdUgaHGVRhFN30vIDqSlfDAmvbWCTVNZWPu9mRu6ewn4RMN16NbycySVCTbnIK YyMrS3jsGCeMskj1kiEm5kjCslQSAxM808nG9U3ogRunSg7+6zNOeKjT2UoAlnnuObjJ 1zdDpbBXtmvn12Dhh4UMQjww+Yc5SRY2VDEtU= Received: by 10.204.141.14 with SMTP id k14mr3406858bku.37.1305840904986; Thu, 19 May 2011 14:35:04 -0700 (PDT) Received: from vT510.golden.ru ([2.93.207.146]) by mx.google.com with ESMTPS id c11sm1757506bkc.14.2011.05.19.14.35.03 (version=SSLv3 cipher=OTHER); Thu, 19 May 2011 14:35:04 -0700 (PDT) From: Vitaliy Gusev To: Trond.Myklebust@netapp.com Cc: andros@netapp.com, linux-nfs@vger.kernel.org, Vitaliy Gusev Subject: [PATCH] nfs41: Correct offset for LAYOUTCOMMIT v2 Date: Fri, 20 May 2011 01:34:46 +0400 Message-Id: <1305840886-18945-1-git-send-email-gusev.vitaliy@nexenta.com> X-Mailer: git-send-email 1.7.4.1 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, 19 May 2011 21:35:51 +0000 (UTC) A client sends offset to MDS as it was seen by DS. As result, file size after copy is only half of original file size in case of 2 DS. Signed-off-by: Vitaliy Gusev --- fs/nfs/pnfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index f57f528..101c85a 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1009,7 +1009,7 @@ void pnfs_set_layoutcommit(struct nfs_write_data *wdata) { struct nfs_inode *nfsi = NFS_I(wdata->inode); - loff_t end_pos = wdata->args.offset + wdata->res.count; + loff_t end_pos = wdata->mds_offset + wdata->res.count; bool mark_as_dirty = false; spin_lock(&nfsi->vfs_inode.i_lock);