Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3964419pxf; Mon, 29 Mar 2021 17:02:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYAQDDJvKGUIkKlFNruRsR9qeY0xEhfQ6/RC9sWEJ89zH0ZzwUezeavgzdK4AgsM3BOjkc X-Received: by 2002:a05:6402:2076:: with SMTP id bd22mr30470223edb.378.1617062541298; Mon, 29 Mar 2021 17:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617062541; cv=none; d=google.com; s=arc-20160816; b=zu39zpmo16sTKr23/AV3UVoItTbutMtCkNRUPcrrjBhZNIV/fx6hOXpd8H7XTwd7Iy QjUrOtFuuSf19oIXJg5CNNZwE+pl04JpbIwcxjYM5qn47zYvQ7mUX4vZvidcxrtaejt/ w6pcAVF6+lWc4ufRCaZ0zsXDGbIulKZAg5GLPSXxL4nB51tVoV8ffH4PxZE2JFj/3DNe oyz91WF3Mv05RC6XVE96ffSsaglQq/LUMXrLx2a3I04bSEFX2CL67fMF2bHsGbTPIzpc ohB4QgGeX2xG4B+Zxwb/i6z9EFvHvh1zb5L00OGEaSQ+3QQgyuSaez0FFouTxyAhS9HT D37g== 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=wX7uGxWq9kFCp9EzvSMnQnOD0SIpKyanycj9x8n/MeA=; b=V9VZxWcsFu5OwwJU46LyQgv5UT4I0x56BQmJcDQ64moOx2rue47/yUO0hE+b7Twqkv hQJpcHOceWqBsOkaiPrFf1kFHKu+U7IjWYQwSEEnWsAbdPA+T+j54g+au1TKY0AuCfW5 64V2J2u607TwuhPRBfHJSSZvIWkeYyV4cjznmE0hzGmruq3jK13sPE3lR7iIXdakFHGZ IXnimnMjHCRhTBW4eVRZD/sfbMtJIBkpKe9G9bPJJUkDkE+XD7pqhSBz6N/QnCRXZzn8 7/DLZPp4ITM9xsNIKqiW4mtEPlbv83BNZg1uQRfEk81gOqdZZvPPm9H3m7JvqdUOh3wM t9Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qwls112K; 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 kg8si14368532ejc.642.2021.03.29.17.01.48; Mon, 29 Mar 2021 17:02:21 -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=qwls112K; 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 S230364AbhC3AAo (ORCPT + 99 others); Mon, 29 Mar 2021 20:00:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:47284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbhC3AA1 (ORCPT ); Mon, 29 Mar 2021 20:00:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 858B56191B for ; Tue, 30 Mar 2021 00:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617062426; bh=gybvpyBgkLAZU65DjL+UtXkCiWHYSDuVT+0kcOPqPZg=; h=From:To:Subject:Date:From; b=qwls112K6h/5G+WSD06LGxU8BKWfl1arb2DjWBHW+mqf5IXsCpOEkcE7CcHclSWDQ p/BTA2q4dcmH0JP94WC6VOtwmaQSoz2WmxOM3vwoweDehGjsI+ZUO9k15fJlx/QL8x UHRnXOaD//OSU8YjQPqRbGwJ8xjzO0WIt60kZVTtYQea1LgQTmjo4VZF2dXjAzf021 QNsv5DEfKMzbvKpRct4iVgfsXBTpSo5u//PUSnKzjKE8ZZtFMxPPfgx2CNDZ2TBKlF FKtQw+zWp7N/TfuXqcOkRIUrU6IK8T6wTIZ10IY7LpdX4k8CCBUfvcCuPhojdCasDm oEOKL3LOmHVVw== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH] NFS: Fix fscache invalidation in nfs_set_cache_invalid() Date: Mon, 29 Mar 2021 20:00:23 -0400 Message-Id: <20210330000023.41367-1-trondmy@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Ensure that we invalidate the fscache before we strip the NFS_INO_INVALID_DATA flag. Signed-off-by: Trond Myklebust --- fs/nfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index a7fb076a5f44..ff737be559dc 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -223,11 +223,11 @@ void nfs_set_cache_invalid(struct inode *inode, unsigned long flags) if (!nfs_has_xattr_cache(nfsi)) 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); nfsi->cache_validity |= flags; - if (flags & NFS_INO_INVALID_DATA) - nfs_fscache_invalidate(inode); } EXPORT_SYMBOL_GPL(nfs_set_cache_invalid); -- 2.30.2