Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp641456pxb; Wed, 29 Sep 2021 06:50:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycklMtIt6wcJa9NGfkAD5x8vqvbzkInL7fBhf0WcluUphurbzHH6h8BegCI77SEu0gyCgt X-Received: by 2002:a17:903:187:b0:13d:fd13:8862 with SMTP id z7-20020a170903018700b0013dfd138862mr65151plg.85.1632923426436; Wed, 29 Sep 2021 06:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632923426; cv=none; d=google.com; s=arc-20160816; b=V8/xIQimIptw3zW5iXijgNhmQfMgI71MugecpcU3BKvGY8bg64PzqhLguZs5EF/8UU 0gHy1jOEQbviM4884+BAG+NvD60uRvquxWMWyfm9xEy5yxEto0kfP1kiOE7ZQAJG+UnA EluLHhq0Lr3befHfx5C2rwwo1If3ZKEKdBBZ/02YtTDbEGCCwfGX+/XCJRM549yprriG XBIH8nEPIQHqwyU8Ac2VPvAWoFvuY5F6a89fnB/Y1yFMAzMzlWna9Hk+1OF3nt9Q5iiu /vbno8ikx+JculOqYEX60OMAPgH1NTPzZMJWRGi3tphsxr92aEtPJ329qDLkFLqVj5wJ j5og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=XgNBy3Lg0UwszEWLoC2S2klQy6HU4xYurcktQCnbX4k=; b=DugvMXzS8AoAd8qa9TOqNmDKaMEX7JDz0pCSt8acaJsB3RnL4PNNz45vvTG55xt99w erxpyQIKhNNb1m9KJ3RSTXPhZTx6MLYmEJ/F9RtKL3hNZ6ed5s1kq/1dDYBOuxoQTV91 yqBDCHrF/bR0jflSEFtCY7tDvxps9cFS2k90ThDqYyVRoG6NSBPtscJXQFHgpN+i1qu4 3zQQjzVg3nyqAZ3yWTzxQ+aODpXKz90NX/Xa/daOQAlmmiym29ct26eK2y0b9apn//QM jbzKbpyUw1Z4N18wjbaa+r7oAqb+QtLmyj3KfI/VqdijUAu2iLb3Rh5UHdO7j6AUrznG sp+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RHB85BWu; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e125si3195034pfe.83.2021.09.29.06.50.03; Wed, 29 Sep 2021 06:50:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RHB85BWu; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344314AbhI2Nv1 (ORCPT + 99 others); Wed, 29 Sep 2021 09:51:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:36004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344273AbhI2Nv0 (ORCPT ); Wed, 29 Sep 2021 09:51:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A9891613A9 for ; Wed, 29 Sep 2021 13:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632923385; bh=jEJG5fJNarbSEkt+raE0Nj5Yif+ZxMIBuFhYajUUpnk=; h=From:To:Subject:Date:From; b=RHB85BWupXOqEQIInD5kQHYKqy0UfCW0Y5qxgP9QsSqIwzGvXSOopO1p2YdpKMfhJ 3SRg4yWG7SPOgnRlpCW1FaQFKg+hJMzRvX3cHVo24X5mciP1WsGp8s869navcDCzgk yDMt3oaktZyFDLkiLvH7pAbKSadyyeJQtmHr9L+cgoeq/4bhK2YL9liOdVX3A9Hh1y TaGBZLWtWvRxSwKsbOcpD9qiUeqjYA/pBxEZ0bU3JxxNXv7fcyYB7fdGu9BD7VLN6k rzS5SxaWJtnlWHI80HyAo6SrPFa3C31/qaK9X7cxUNlgQKmkhuk/PyV9+mDTY3Ilx/ qwxsm88H7yvaA== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 1/5] NFS: Don't set NFS_INO_DATA_INVAL_DEFER and NFS_INO_INVALID_DATA Date: Wed, 29 Sep 2021 09:49:40 -0400 Message-Id: <20210929134944.632844-1-trondmy@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust NFS_INO_DATA_INVAL_DEFER and NFS_INO_INVALID_DATA should be considered mutually exclusive. Fixes: 1c341b777501 ("NFS: Add deferred cache invalidation for close-to-open consistency violations") Signed-off-by: Trond Myklebust --- fs/nfs/inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 0f092ccb0ca1..dcb885b7ad73 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -210,10 +210,15 @@ void nfs_set_cache_invalid(struct inode *inode, unsigned long flags) flags &= ~NFS_INO_INVALID_XATTR; if (flags & NFS_INO_INVALID_DATA) nfs_fscache_invalidate(inode); - if (inode->i_mapping->nrpages == 0) - flags &= ~(NFS_INO_INVALID_DATA|NFS_INO_DATA_INVAL_DEFER); flags &= ~(NFS_INO_REVAL_PAGECACHE | NFS_INO_REVAL_FORCED); + nfsi->cache_validity |= flags; + + if (inode->i_mapping->nrpages == 0) + nfsi->cache_validity &= ~(NFS_INO_INVALID_DATA | + NFS_INO_DATA_INVAL_DEFER); + else if (nfsi->cache_validity & NFS_INO_INVALID_DATA) + nfsi->cache_validity &= ~NFS_INO_DATA_INVAL_DEFER; } EXPORT_SYMBOL_GPL(nfs_set_cache_invalid); -- 2.31.1