Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3946178pxb; Tue, 17 Nov 2020 07:35:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyg2QJl8gGPWQFFjgTcaYvwKjQLhkABPx/V8JPvCdZs+K7T5CWtprNy1efpQOTCZZSsUlQs X-Received: by 2002:a50:b761:: with SMTP id g88mr21428990ede.387.1605627342587; Tue, 17 Nov 2020 07:35:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605627342; cv=none; d=google.com; s=arc-20160816; b=Fi+RZmpiSjm+dewMT98fwCKZ7GgRTapLdAty/ZOYIuR5lPhEYA4G9DSvXmGWkS/aJ6 Sbp+WiHZEd9900RWAvpJcz7yVwsQRfRTl628+40gcNUJaVTeofOD7jlsIDmqc589BjV1 X+V5+/w0NIKzFPqo5BRfaFz4BH77Wa3wOCUrIjrCjQqJfaj1x+U4EeI/E3rS6bjNGY1h fLKPUO+aTta5BKILKjk99xOjCGswTPBke2F1SGSJcWyBj1jxemVa6k1FdxxQDNUCuPkc nb5bLcF1INBSE6NsK8az0EnnFrDi3J9wFXp1rSQ5OpLFKDs7hmZ3B2eydV3vwpwOi3w7 fenw== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=FTud5bJ8j/lh335K7uJJZfUTcTCnUWqRYiqBw6jLhqI=; b=eScOeH1LJssAVW49Hlozthb/ERpx4RoPZ9g1a2+6u+ZJgvDgoX4zA1MKriRkzkj9Sf jyFP7K5G2qvXDkiUWIh9zs0p07+19qwcWiKqOxhYCGfQBTCToeHzS+htU/xB5tJeu2Nq /yycQlidv5JsQDVOTCLfRSf8ij1f6rJni/AVdrO3u7jB6Hil/77hE7wHgi7weCjdXOKw qMbYiR7hUxyG2Leacptj5FdEfnWJ6YWSnAwy6Who+yMYpKv6h+oI12ih/7DmAhbtSPaX 4e0nf1oU5tQmVr+n8gRU/n+YIbijG4wo3OvB/IVTfJlJGKt69hmEv4Euc1v4C05TiQA6 tJ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kPx6L6Vy; 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 bl4si15650566ejb.642.2020.11.17.07.35.14; Tue, 17 Nov 2020 07:35:42 -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=default header.b=kPx6L6Vy; 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 S1726146AbgKQPe7 (ORCPT + 99 others); Tue, 17 Nov 2020 10:34:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:48992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbgKQPe7 (ORCPT ); Tue, 17 Nov 2020 10:34:59 -0500 Received: from tleilax.poochiereds.net (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3AD312222A; Tue, 17 Nov 2020 15:34:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605627298; bh=el8G+Am8q1n3OH+POVa4s76h0YooRTNz9Js8xrSRXV0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=kPx6L6Vyde9MYeq2nGGqmACfxBHr/2+RbE+x0OVjH2UC1ZVd+UrugVm/YG1d0WilI pukdCvk+38nRShKAiklWyhTurGrvC/e6CQF062ksz0L0U/bvxQZCFcX2rozx2RiVSz +z7nXzPL7aOvMGGrHgfbKzB4kX8Sjbh5rk7V+BH4= Message-ID: <725499c144317aac1a03f0334a22005588dbdefc.camel@kernel.org> Subject: Re: [PATCH 2/4] nfsd: pre/post attr is using wrong change attribute From: Jeff Layton To: "J. Bruce Fields" Cc: "J. Bruce Fields" , Daire Byrne , Trond Myklebust , linux-cachefs , linux-nfs Date: Tue, 17 Nov 2020 10:34:57 -0500 In-Reply-To: <20201117152636.GC4556@fieldses.org> References: <20201117031601.GB10526@fieldses.org> <1605583086-19869-1-git-send-email-bfields@redhat.com> <1605583086-19869-2-git-send-email-bfields@redhat.com> <20201117152636.GC4556@fieldses.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.1 (3.38.1-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, 2020-11-17 at 10:26 -0500, J. Bruce Fields wrote: > On Tue, Nov 17, 2020 at 07:34:49AM -0500, Jeff Layton wrote: > > I don't think I described what I was thinking well. Let me try again... > > > > There should be no need to change the code in iversion.h -- I think we > > can do this in a way that's confined to just nfsd/export code. > > > > What I would suggest is to have nfsd4_change_attribute call the > > fetch_iversion op if it exists, instead of checking IS_I_VERSION and > > doing the stuff in that block. If fetch_iversion is NULL, then just use > > the ctime. > > > > Then, you just need to make sure that the filesystems' export_ops have > > an appropriate fetch_iversion vector. xfs, ext4 and btrfs can just call > > inode_query_iversion, and NFS and Ceph can call inode_peek_iversion_raw. > > The rest of the filesystems can leave fetch_iversion as NULL (since we > > don't want to use it on them). > > Thanks for your patience, that makes sense, I'll try it. > There is one gotcha in here though... ext4 needs to also handle the case where SB_I_VERSION is not set. The simple fix might be to just have different export ops for ext4 based on whether it was mounted with -o iversion or not, but maybe there is some better way to do it? -- Jeff Layton