From patchwork Fri Jun 20 17:41:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 4391361 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 5D52F9F314 for ; Fri, 20 Jun 2014 17:41:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96E2C20306 for ; Fri, 20 Jun 2014 17:41:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BCBC2202FE for ; Fri, 20 Jun 2014 17:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757083AbaFTRl3 (ORCPT ); Fri, 20 Jun 2014 13:41:29 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:58394 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757071AbaFTRl2 (ORCPT ); Fri, 20 Jun 2014 13:41:28 -0400 Received: by mail-ie0-f172.google.com with SMTP id lx4so3530262iec.31 for ; Fri, 20 Jun 2014 10:41:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yS703Lm6duTvz4MnLRk+AoIvhorPBpf2PwRyEB/2BoI=; b=LxuBcrZo1ZInARp7MMvK4614UXjvEZV+/i9XpLySC3v6gtDJ68SZz0Op9SFctKPzre Mjh704+bsKbsGXTCpadTpRwo5erZuOpKYqpbQ/vdsQe2JMPa/lVPobIM8/HMtLt6G3ag r5MqtdUavDw7+T0nQvQ95H3I/JLvvjsd0ceqHoQInCIcN5xYC/v+Br9rk2Gd4fm54jNw laLkLgO/Gn3g6ty0nUgniuSzPvFEYRn66k/HZldpNDdSUWAmnDWOaEJNymmOI7sEQmCX RMMyfSq6fD/eMKWjJaOcRSeux91eagz81uq1ulhhvDG2wr9SCkJYKR2iK5QVTxn9TZCn J+Qw== X-Gm-Message-State: ALoCoQmvgzS5ht7s3QflF6QW1ZH1Q36oT+ZaKzANTHLlXG03WWNc9Gb5oLQ8aIMSh0MeL+K/jti1 X-Received: by 10.42.27.147 with SMTP id j19mr5381223icc.81.1403286087867; Fri, 20 Jun 2014 10:41:27 -0700 (PDT) Received: from leira.trondhjem.org.localdomain (50-33-230-70.drr02.mskg.mi.frontiernet.net. [50.33.230.70]) by mx.google.com with ESMTPSA id k5sm6081520igf.5.2014.06.20.10.41.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jun 2014 10:41:27 -0700 (PDT) From: Trond Myklebust To: Scott Mayhew Cc: Linux NFS Mailing List Subject: [PATCH 1/3] NFS: Clear NFS_INO_REVAL_PAGECACHE when we update the file size Date: Fri, 20 Jun 2014 13:41:21 -0400 Message-Id: <1403286083-14345-2-git-send-email-trond.myklebust@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1403286083-14345-1-git-send-email-trond.myklebust@primarydata.com> References: <20140620125140.GH4510@tonberry.usersys.redhat.com> <1403286083-14345-1-git-send-email-trond.myklebust@primarydata.com> 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, 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 In nfs_update_inode(), if the change attribute is seen to change on the server, then we set NFS_INO_REVAL_PAGECACHE in order to make sure that we check the file size. However, if we also update the file size in the same function, we don't need to check it again. So make sure that we clear the NFS_INO_REVAL_PAGECACHE that was set earlier. Signed-off-by: Trond Myklebust --- fs/nfs/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index c496f8a74639..51dda21ebc4e 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1601,6 +1601,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) if ((nfsi->npages == 0) || new_isize > cur_isize) { i_size_write(inode, new_isize); invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; + invalid &= ~NFS_INO_REVAL_PAGECACHE; } dprintk("NFS: isize change on server for file %s/%ld " "(%Ld to %Ld)\n",