Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3888773pxb; Tue, 17 Nov 2020 06:15:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwu1RM1hjj3ld3kdjUozA2uPjH1/P5kGZ0YAXS6wFGVNJv7gm3oEsAStNFb8mnfFXnXZyOx X-Received: by 2002:a17:906:560e:: with SMTP id f14mr15642885ejq.335.1605622546189; Tue, 17 Nov 2020 06:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605622546; cv=none; d=google.com; s=arc-20160816; b=XZdZZvOhS4bo3LgOwwn5C9rfsgqdW+WQw0r/Cl7i/vaTbIVOzqTRJOYxMTvwpqsTEj rqQtDKfm3qW/4o1Ei64pyL2xQJNPIIasZdNA+9ebV4JtyArct0MpwR7aYEJPZPS8Xnw/ WXlroUgPNS3fcIMNKNjsn0ZJM+dzjPUiajzCb/lRKcoqJU8/8TJ3Pb6mxkVnIS0Jt64W kz7l4W5HHjiZMJZ0xOsAfZwmJTgo6XS73tYGnbZvdEoC0s3fP8Lj+idriP4+ok21bZWK Y/2nZoqgWKpfZZCDofgbhQF53oq/GZCM4UJ9HdPGS6H1mEzjvXpa8+2iXkItdWJ3bwgE t6sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:from:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:date:dkim-signature:dkim-filter; bh=mv9E/otnrADzIvuQoj37YLUWkP9ALGzv5ewIs91gTWc=; b=v8BIkoQ/+PtIzDC0eCRjZWXJ6m68cCKkPCSyUPxvPLw63FkSnY2PF7QMjJQPQihaYA IxySUdIFGlJlDrGC4pZ0YZxEcB9yyDBofL/5IGXbFNRl68gGLVbWbc82mk0eqHz2vCqa KtxxFTBx7O+vN14HkN5w7I7shyTnSuhU2nC6VRk6QKJ1AXN+fFA2Rrz9SWf8aQcsg/IN Ju5UtP5rsBrzBGGGR62589+2pkf2nGeoQaEsNA4f2XFVW4YNLg9GIRQwSkhBjHs5X2t1 OtD7EtSRi/CltKIV2vAdymMw/k4EzG90n5R8wYtpHbkZoOVwZVdnf3XFlv8c5s4mjlDW SQ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b="F9ZvMA/n"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si14341995edq.36.2020.11.17.06.15.14; Tue, 17 Nov 2020 06:15:46 -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=@fieldses.org header.s=default header.b="F9ZvMA/n"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728269AbgKQOOG (ORCPT + 99 others); Tue, 17 Nov 2020 09:14:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728176AbgKQOOG (ORCPT ); Tue, 17 Nov 2020 09:14:06 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A9BFC0613CF for ; Tue, 17 Nov 2020 06:14:06 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id 29B131CE6; Tue, 17 Nov 2020 09:14:05 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 29B131CE6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1605622445; bh=mv9E/otnrADzIvuQoj37YLUWkP9ALGzv5ewIs91gTWc=; h=Date:To:Cc:Subject:References:In-Reply-To:From:From; b=F9ZvMA/nhE8Os6dU0Wb8gOcIHOfogaGuKp+xpCMLG20weX+7hPH/ohANtiD3sYB/c HSi11f4Cq1oWNmilb8j/hIQdHvuIarj3obWuTjkyjorHOOfYJkZ1Qy0IbHRXxvirgD 9jadrufOpQqmPI0V/T2eg6XhHTwPdDD/DSUJywZg= Date: Tue, 17 Nov 2020 09:14:05 -0500 To: Jeff Layton Cc: "J. Bruce Fields" , Daire Byrne , Trond Myklebust , linux-cachefs , linux-nfs Subject: Re: [PATCH 3/4] nfs: don't mangle i_version on NFS Message-ID: <20201117141405.GA4556@fieldses.org> References: <20201117031601.GB10526@fieldses.org> <1605583086-19869-1-git-send-email-bfields@redhat.com> <1605583086-19869-3-git-send-email-bfields@redhat.com> <4be708fffc15a27560c378af20314212e8594f85.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4be708fffc15a27560c378af20314212e8594f85.camel@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Nov 17, 2020 at 07:27:03AM -0500, Jeff Layton wrote: > On Mon, 2020-11-16 at 22:18 -0500, J. Bruce Fields wrote: > > From: "J. Bruce Fields" > > > > The i_version on NFS has pretty much opaque to the client, so we don't > > want to give the low bit any special interpretation. > > > > Define a new FS_PRIVATE_I_VERSION flag for filesystems that manage the > > i_version on their own. > > > > Description here doesn't quite match the patch... Oops, thanks.--b. > > > Signed-off-by: J. Bruce Fields > > --- > >  fs/nfs/export.c | 1 + > >  include/linux/exportfs.h | 1 + > >  include/linux/iversion.h | 4 ++++ > >  3 files changed, 6 insertions(+) > > > > diff --git a/fs/nfs/export.c b/fs/nfs/export.c > > index 3430d6891e89..c2eb915a54ca 100644 > > --- a/fs/nfs/export.c > > +++ b/fs/nfs/export.c > > @@ -171,4 +171,5 @@ const struct export_operations nfs_export_ops = { > >   .encode_fh = nfs_encode_fh, > >   .fh_to_dentry = nfs_fh_to_dentry, > >   .get_parent = nfs_get_parent, > > + .fetch_iversion = inode_peek_iversion_raw, > >  }; > > diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h > > index 3ceb72b67a7a..6000121a201f 100644 > > --- a/include/linux/exportfs.h > > +++ b/include/linux/exportfs.h > > @@ -213,6 +213,7 @@ struct export_operations { > >   bool write, u32 *device_generation); > >   int (*commit_blocks)(struct inode *inode, struct iomap *iomaps, > >   int nr_iomaps, struct iattr *iattr); > > + u64 (*fetch_iversion)(const struct inode *); > >  }; > >   > > > > > > > > > > > > > > > >  extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, > > diff --git a/include/linux/iversion.h b/include/linux/iversion.h > > index 2917ef990d43..481b3debf6bb 100644 > > --- a/include/linux/iversion.h > > +++ b/include/linux/iversion.h > > @@ -3,6 +3,7 @@ > >  #define _LINUX_IVERSION_H > >   > > > > > > > > > > > > > > > >  #include > > +#include > >   > > > > > > > > > > > > > > > >  /* > >   * The inode->i_version field: > > @@ -306,6 +307,9 @@ inode_query_iversion(struct inode *inode) > >  { > >   u64 cur, old, new; > >   > > > > > > > > > > > > > > > > + if (inode->i_sb->s_export_op->fetch_iversion) > > + return inode->i_sb->s_export_op->fetch_iversion(inode); > > + > > This looks dangerous -- s_export_op could be a NULL pointer. > > >   cur = inode_peek_iversion_raw(inode); > >   for (;;) { > >   /* If flag is already set, then no need to swap */ > > -- > Jeff Layton