From patchwork Fri Nov 14 07:04:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 5303891 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 709E19F440 for ; Fri, 14 Nov 2014 07:04:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1BE22017D for ; Fri, 14 Nov 2014 07:04:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02B8820121 for ; Fri, 14 Nov 2014 07:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754331AbaKNHEF (ORCPT ); Fri, 14 Nov 2014 02:04:05 -0500 Received: from verein.lst.de ([213.95.11.211]:45364 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752632AbaKNHEF (ORCPT ); Fri, 14 Nov 2014 02:04:05 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id C65DB14072; Fri, 14 Nov 2014 08:04:01 +0100 (CET) Date: Fri, 14 Nov 2014 08:04:01 +0100 From: Christoph Hellwig To: Weston Andros Adamson Cc: Peng Tao , Trond Myklebust , linux-nfs list Subject: Re: [PATCH] NFS: fix subtle change in COMMIT behavior Message-ID: <20141114070401.GA3944@lst.de> References: <1415812080-3033-1-git-send-email-dros@primarydata.com> <20141113110244.GA25709@lst.de> <6E1CB959-CB60-4AE3-9392-65ABDF0DB2F0@primarydata.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6E1CB959-CB60-4AE3-9392-65ABDF0DB2F0@primarydata.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch below passes block layout testing for me: From: Christoph Hellwig Subject: pnfs/blocklayout: fix end calculation in pnfs_num_cont_bytes Use the number of pages in the pagecache mapping instead of the number of pnfs requests which is only slightly related. Reported-by: Weston Andros Adamson Signed-off-by: Christoph Hellwig --- fs/nfs/blocklayout/blocklayout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 5228f20..98d4900 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -812,7 +812,7 @@ static u64 pnfs_num_cont_bytes(struct inode *inode, pgoff_t idx) /* Optimize common case that writes from 0 to end of file */ end = DIV_ROUND_UP(i_size_read(inode), PAGE_CACHE_SIZE); - if (end != NFS_I(inode)->npages) { + if (end != inode->i_mapping->nr_pages) { rcu_read_lock(); end = page_cache_next_hole(mapping, idx + 1, ULONG_MAX); rcu_read_unlock(); -- 1.9.1