Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp44360pxf; Wed, 24 Mar 2021 20:26:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJb7Lx2IiUt646xJa6VSuBtx8S51p65WLIF0oa4HJAlniWA7q6Swnvi45scf411XnxChv8 X-Received: by 2002:a05:6402:510b:: with SMTP id m11mr6822423edd.103.1616642789229; Wed, 24 Mar 2021 20:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616642789; cv=none; d=google.com; s=arc-20160816; b=qL2I/fxDaGH8tg1FGGGCIo87VrcL1qmCH6qNb59gR9kpJHLiwNHCZlL/VYkEpAh6vv Ytd5hg1k8btRux9HAYooILhd6b3XUFYE0xmVMs92CH1C2ddEFRazI+XH+eRKGKabAZS8 iaMDNLRb1ovPJ/m6icjh0KjKVXWWKxbdbmH0mhl49sbrdZXTtEn4eVNPxTSlX5ZQzdAr yhttriqh1S33lXN5V9C0/RBbBg1Kzwj2lFyzyaiCp+n+FIrT3lVZkw6hFCrVwtnU+Ask uhTMo+izitBhslqBQUT7pXNq2E1OkYZ9Cu893heR5cF49NyvVqyjr4S0dHb8bfwTsngQ M7Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7XUIbWuoAOjbMJGwp7K2r0/RMkw4ElcGdb9YG/13DPM=; b=CZV+WO6OMw30D3qF8js5CLclDVsl+Y9Ww3eDga9Ymdk5fU5Q+moqURtFJVXWe85Xjx HRll5ogjXqyEjnN40EUZDwTlgUOf+BYdqQBrDePnoLAEJYSUwJnIhHpu8k93as00VKY4 gX8H5wfKBJCVhyYZ34MR8q5qJdAjiJvo6SsbOS4LtJ91Om2zBrQ0Blm9UzNRntJeaHKN TWPox0UXLs4ofZBp9U5oUwnU5YQQyXe0yDCc/yHGm5zhG2liI0JFaVbcLzb4UhXNnNai taqa8LtYyAN2IVqSbOJezrV8jcshnxWzML8E5LPwG0iQyu9l16Qfp37DzAgYOs9pOao9 pqZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E82fp94G; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt8si3290176ejc.111.2021.03.24.20.25.32; Wed, 24 Mar 2021 20:26:29 -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=@redhat.com header.s=mimecast20190719 header.b=E82fp94G; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238277AbhCXVXt (ORCPT + 99 others); Wed, 24 Mar 2021 17:23:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21755 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238292AbhCXVXs (ORCPT ); Wed, 24 Mar 2021 17:23:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616621028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7XUIbWuoAOjbMJGwp7K2r0/RMkw4ElcGdb9YG/13DPM=; b=E82fp94GAIqEt7BzgMXrjASkx4+p9YbFOaVIX4zg236z/pxVeXYs9NWVH13ZHKO207IaCN E1/Q6qnVIOVrgHhPvdLOhf9njqv2yTAyOuO4LK29iWZ9f96kjYNj7Ws2BTD31o3zA8Ak6+ /whFVYBRjTYyQiJiG0ijSEFqAfJuklU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-218-stFEObQKOhaosDurdUdx-A-1; Wed, 24 Mar 2021 17:23:44 -0400 X-MC-Unique: stFEObQKOhaosDurdUdx-A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84E32801817; Wed, 24 Mar 2021 21:23:43 +0000 (UTC) Received: from pick.fieldses.org (ovpn-116-27.rdu2.redhat.com [10.10.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B6791992D; Wed, 24 Mar 2021 21:23:43 +0000 (UTC) Received: by pick.fieldses.org (Postfix, from userid 2815) id C76BF120207; Wed, 24 Mar 2021 17:23:39 -0400 (EDT) Date: Wed, 24 Mar 2021 17:23:39 -0400 From: "J. Bruce Fields" To: trondmy@kernel.org Cc: linux-nfs@vger.kernel.org, Chuck Lever Subject: Re: [PATCH] NFS: fix nfs_fetch_iversion() Message-ID: References: <20210324195353.577432-1-trondmy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210324195353.577432-1-trondmy@kernel.org> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Mar 24, 2021 at 03:53:53PM -0400, trondmy@kernel.org wrote: > From: Trond Myklebust > > The change attribute is always set by all NFS client versions so get rid > of the open-coded version. Thanks! I'm unclear whether there's a user-visible bug here or whether it's mainly cleanup? --b. > 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 >