Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp671869pxf; Wed, 24 Mar 2021 13:00:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEngY/VCMP8+taWp31z5TlkveapJzHph+HJegOlGF6LZ1c86yqLuqPSNMVTioBQrbVHtq7 X-Received: by 2002:a17:906:39a:: with SMTP id b26mr5733673eja.158.1616616040535; Wed, 24 Mar 2021 13:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616616040; cv=none; d=google.com; s=arc-20160816; b=04hXvLNgFb/E29vHrJzeZeFu7584YlQ5HRvxQ8iG53RPLziyGeRaJmQEsKvDUtVBNk bvefN/0CdJYk5E9hw4ScRs4taZ1dm/1TD8ZHxGhMixKG5t1fzcqI6PGoAp/a2t0KKLJW Ht3eyiR4zHytPLKlYiR2YmVV8nMEunx4I0XMrizRB3l7FIZKNTdL8e+8a49usJnQGYde cwYfdzGUVSPgyVmM7O+heMj3bGDN5+Y3t0boHXWmxSOGkxVv7ANw/Ie0mP/88SzSDQ1u K967BdpGateOU5s/twtxQm2I8s76e/ui01dvibLQTgtX/bhDS7Ug+0ZDqOHL5zD+rwtz xVqA== 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=Ak33waJBoTqn573UvMJ8xzD7JwsqQ3KZ9C9M2Oyc3l8=; b=QfHC68TPVuCd/HUAy7nhYx1VZdcFB6sb/Y0TabMZQbmT+cy3Oe08HpkH/4G35uiVDm TQV16tvGLa01ToB60BylCu/sGeZiKjJ9TtcvJaZuK4yXNAimf9fkqEYMXH/VzlboWFn9 nLi/LGYo7ElaCgBKsVI2v9BskrjCzJIdRbU0yJeCO3JA/Upf3RS0mz9GcSvFjg/R7geR I0rANN6HCzhOFMOKxKXw3nrsFm3QBu7NN/Nimtke2I/Z/ta3yhj+A2YvypsUWAtUswTH Ig1suMtcNSnaovFfbYKvlpmfXfPTsgn2PtmozgvBlVyKWs4uHsc9cs/GNIDwfcM1n8yK 5KHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mp72TLmI; 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 f9si2699886ejk.446.2021.03.24.13.00.12; Wed, 24 Mar 2021 13:00:40 -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=mp72TLmI; 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 S237807AbhCXTy0 (ORCPT + 99 others); Wed, 24 Mar 2021 15:54:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:45516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237988AbhCXTxz (ORCPT ); Wed, 24 Mar 2021 15:53:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B53FE61A25; Wed, 24 Mar 2021 19:53:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616615635; bh=ecFlRpAXfv6ERDufsKh1iuuuyOp8pPZVV3oduTd3dMc=; h=From:To:Cc:Subject:Date:From; b=mp72TLmIf6+F8KfEvTYw+7sHFBeRt5U2mn6gme6PCVcL+1HOT4Y+uDHFbxRg5L+Mf JajdaPbqLhxDxoX8wr72RGqMYKCZyUOWOg5gqj3q9A+IQc7UzwOP6BYgUSA/22bpJV wSPy1qcr1/YRcjlfiaOUt5FPW2XfC6SruQI57dNlde7F97ipgaVPePk9xbQn29B6kd ZDizlFot8nByuYhtEhjlf7JfV/+a05clq01H/cD3HzNHjg1HKNXeWwtHC28wvVgoja Oyq50T5W8LeoLAFaRH2PoUoOYmP6DkgtyN/IWG6RbyY3zjPSrho2T0wImsmhmaUdye ZmykpyTjeLxrQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: "J. Bruce Fields" Subject: [PATCH] NFS: fix nfs_fetch_iversion() Date: Wed, 24 Mar 2021 15:53:53 -0400 Message-Id: <20210324195353.577432-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 The change attribute is always set by all NFS client versions so get rid of the open-coded version. Fixes: 3cc55f4434b4 ("nfs: use change attribute for NFS re-exports") Signed-off-by: Trond Myklebust --- fs/nfs/export.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/fs/nfs/export.c b/fs/nfs/export.c index f2b34cfe286c..b347e3ce0cc8 100644 --- a/fs/nfs/export.c +++ b/fs/nfs/export.c @@ -171,17 +171,10 @@ static u64 nfs_fetch_iversion(struct inode *inode) { struct nfs_server *server = NFS_SERVER(inode); - /* Is this the right call?: */ - nfs_revalidate_inode(server, inode); - /* - * Also, note we're ignoring any returned error. That seems to be - * the practice for cache consistency information elsewhere in - * the server, but I'm not sure why. - */ - if (server->nfs_client->rpc_ops->version >= 4) - return inode_peek_iversion_raw(inode); - else - return time_to_chattr(&inode->i_ctime); + if (nfs_check_cache_invalid(inode, NFS_INO_INVALID_CHANGE | + NFS_INO_REVAL_PAGECACHE)) + __nfs_revalidate_inode(server, inode); + return inode_peek_iversion_raw(inode); } const struct export_operations nfs_export_ops = { -- 2.30.2