Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp15057pxb; Mon, 8 Feb 2021 13:48:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcjR3AgQanPE4RqpRvSzadTX0064vXeeKbGFsfUgyEjOO2PLaW052FMVRL6+yG2nFQPmPu X-Received: by 2002:a05:6402:d05:: with SMTP id eb5mr19034168edb.143.1612820894406; Mon, 08 Feb 2021 13:48:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612820894; cv=none; d=google.com; s=arc-20160816; b=OOQq5C1lLhjAVTJq0qj1plB7O7hsdPOtV4XRyHj91aU1XmRawTdDmCJFnL3gnTeWTp J/Ixrcd6rfO72XyNLH0gKFV/DN0ak0cKGaoFZbmy7dn1cex7FWUP36c4nrG7UwKij6Ma b5yoOvrZ4I4S0qoOtP6Grzd1II9nxNN/zbAEhe2hD+DjnZPkMmm3GoW6f+Q3TAXi9gKZ x6zg4pGGhHTvUg4ONO8KhBjceL5+SkbQFc8DN2FRNW09RRQuE/ZX207Jh8WNEp0x589F EcAbX/AEwfH85zL6DnvW9KZOCOb2AdJXfT89JLbu7+9q4oJKFDi7JiGs+7wlcUMhND+j wOFQ== 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:cc:to:from:dkim-signature; bh=xue7elKN96+Lpu5FJh8N8gs8FxtEgn2koVqHTYGv3d4=; b=Ntk+H35q0xQDPX/2ZEkEbjU/xfFIGmRbLQ8lsfENBh0jvyLxMIBG8Kx0EtRE4SNQhU qRCbKuTNsaxVymtRfLghhI9V5t/YvCphQyGxF3LjdatfhghFw2jSMCmQzeyPSRoiyuPN rsEtJn/rmW6r2Gx6mfli7XUdLwitAEdt3BNCondRL43wPB15S+NNVzrTs4ITFDlq0sMJ gkPAX02qT9vCdy+7y7mgmBJOu1I8urM8WdI4Wm5dhx9OiSKTaPvxvKUqSCz0rw2y5pT2 3q4ed5RwwHLj/Yj6SUXWVYp5TBNK5OCu8MuB2f4XeID3+opWNLKOHly91MGKpyZ83N0p Ul0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A3jCd+f7; 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 x2si12265734ejc.177.2021.02.08.13.47.15; Mon, 08 Feb 2021 13:48:14 -0800 (PST) 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=A3jCd+f7; 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 S236847AbhBHVrI (ORCPT + 99 others); Mon, 8 Feb 2021 16:47:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:39598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236331AbhBHVqb (ORCPT ); Mon, 8 Feb 2021 16:46:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 86CA664E9C; Mon, 8 Feb 2021 21:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612820750; bh=+bRUchUNflt75+aPBeC0ybws3CrVRueJ6ZW6HEjaY24=; h=From:To:Cc:Subject:Date:From; b=A3jCd+f7ygaIkPP5Prpz8ygHQ8juywTI3iYjA9rNjhS8IK2/FVYigaS2kx7MXdFRg 08uSyEwt5hpUQ767Lv/raR3mVE72Any5OmZfw/8d98PgawWKzuTkNR1SxpeNEUOws6 fIp6jAobpAb6CMud2KGYhkEDSnBTZl9K/X3Zyt0lycHTc57HP+jQMdVmblrFbmvzZb wBOBvVQaYOfK9nwLoWzMkinynBWX2mvuUk8lgPAp4nHHrSWuH8CJ794TbVg58D4VFx tUDYGOMFk5NuVoK/0IIilzUKgpMDcb8d81KMS8lirw8LC/lvcuv27pNREZVxQtzfge J2tAghe8GvDiw== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH] NFS: Don't set NFS_INO_INVALID_XATTR if there is no xattr cache Date: Mon, 8 Feb 2021 16:45:49 -0500 Message-Id: <20210208214549.289957-1-trondmy@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Signed-off-by: Trond Myklebust --- fs/nfs/inode.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 2533053d764a..1575e3e1dda9 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -195,6 +195,18 @@ bool nfs_check_cache_invalid(struct inode *inode, unsigned long flags) } EXPORT_SYMBOL_GPL(nfs_check_cache_invalid); +#ifdef CONFIG_NFS_V4_2 +static bool nfs_has_xattr_cache(const struct nfs_inode *nfsi) +{ + return nfsi->xattr_cache != NULL; +} +#else +static bool nfs_has_xattr_cache(const struct nfs_inode *nfsi) +{ + return false; +} +#endif + static void nfs_set_cache_invalid(struct inode *inode, unsigned long flags) { struct nfs_inode *nfsi = NFS_I(inode); @@ -209,6 +221,8 @@ static void nfs_set_cache_invalid(struct inode *inode, unsigned long flags) | NFS_INO_INVALID_XATTR); } + if (!nfs_has_xattr_cache(nfsi)) + flags &= ~NFS_INO_INVALID_XATTR; if (inode->i_mapping->nrpages == 0) flags &= ~(NFS_INO_INVALID_DATA|NFS_INO_DATA_INVAL_DEFER); nfsi->cache_validity |= flags; -- 2.29.2