Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3817682pxb; Tue, 17 Nov 2020 04:30:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9wp7eNCvzk5CoXAaSxPQ+vL5apiukNj9zgiVcKxiWJ8AZv6mWSmi5dZpbLMB9g5Y4W5I8 X-Received: by 2002:a50:9e29:: with SMTP id z38mr20954259ede.220.1605616209231; Tue, 17 Nov 2020 04:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605616209; cv=none; d=google.com; s=arc-20160816; b=FO8NCOwnaWuz4DxzAq8gqFOcsr5U56hLnt+8itzEbZlSoCK1KKOgMDMR25H5FHVcjA kRnAQJsCC2RfQGy4fkVigI7uTfGGfegUjoQQlIXW6oOHblzk5uSpKp0vsekxsT+hWeTN yWGMsRWNCGdy86eh0NF5kdgYMCNe4d5hwXv4JgSZHwzrML6CL54B9EPS6zb+2AjpXI/a lG0+11L4D5/3GXX2FivwHS/GF2PerQfcKb+aE8MY215BaBs0/0FZL9cK1wY+38/qqzPP Tw5TG5pP0a1M7QTDDRtturNiOLM1zJ3/M136YIzbAxmALJbBB9DzL6BQquF4AjltO6B2 sD1w== 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=mtz2jNgBJ0xkyWmL3mTfi0olO7ZHv6xPJ5hNdzggCEM=; b=jtHZVE0DGxVQF1cwiiPtiAo9Xgd+w9f2iL9BEfM2F6v/mqtrWlEE0xG746xoCBYU51 aJUbDfbCHP8dNdCOos4h9gi5uEnIvxuzYsxzDuc9hmDQqH9ONYuPicdMRU+xiTjrZSFT q/j7xUyHZYf4xWLn0mOMbdCyjNK1VoKEHkHFfQKMuWOVV9/W1Sdv4Kzv1u71R79/XdUa RtHRzGc4hbi7hgJrV+u+M0WOcAmOpTOEIbZNRhX/VEhLtKuQpawlao7TVL7KkPVkHc3E x1ZMhJfYbMiqx0Oe8FZEo4yxzD7j7wIhqrph/7QSSanMewIBo9MetfzILnQMiSY+rvkA IWQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=etaxxVvS; 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 hr12si13608099ejc.562.2020.11.17.04.29.31; Tue, 17 Nov 2020 04:30:09 -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=etaxxVvS; 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 S1726628AbgKQM1G (ORCPT + 99 others); Tue, 17 Nov 2020 07:27:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:42508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbgKQM1G (ORCPT ); Tue, 17 Nov 2020 07:27:06 -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 9AEF522203; Tue, 17 Nov 2020 12:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605616025; bh=KNzpZq0D/HkUbbQWGlvhsy0dcuMw1SXpoL/sQ9QzeGI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=etaxxVvSlESFEeQrG4DcFK0+FF+MF+UoeIOS/Z43lJIpw9yaro1kE+GL0Gv4LsC0l BEFHzOfnAUFRmzwzFIS8/F1lFIVm2IQ4rlJSLa3I/huLztUMvbqqsICngESpsFXoa8 /T660SovGopn8HwouCpnxl3OurJhRQHqTBrKE4M4= Message-ID: <4be708fffc15a27560c378af20314212e8594f85.camel@kernel.org> Subject: Re: [PATCH 3/4] nfs: don't mangle i_version on NFS From: Jeff Layton To: "J. Bruce Fields" Cc: Daire Byrne , Trond Myklebust , linux-cachefs , linux-nfs Date: Tue, 17 Nov 2020 07:27:03 -0500 In-Reply-To: <1605583086-19869-3-git-send-email-bfields@redhat.com> References: <20201117031601.GB10526@fieldses.org> <1605583086-19869-1-git-send-email-bfields@redhat.com> <1605583086-19869-3-git-send-email-bfields@redhat.com> 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: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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... > 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