All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: NeilBrown <neil@brown.name>, Chuck Lever <chuck.lever@oracle.com>
Cc: Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>,  Tom Talpey <tom@talpey.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2 02/14] nfsd: replace fh_fill_both_attrs() with fh_fill_post_noop()
Date: Mon, 06 Jul 2026 12:15:07 -0400	[thread overview]
Message-ID: <e6b08d28b3e7b6ee3dbbb482a33d58c2bc420245.camel@kernel.org> (raw)
In-Reply-To: <20260705222032.1240057-3-neilb@ownmail.net>

On Mon, 2026-07-06 at 08:19 +1000, NeilBrown wrote:
> From: NeilBrown <neil@brown.name>
> 
> fh_fill_both_attrs() is only needed for open/create and is used in the
> case when the target already existed so no creating happens.
> 
> As part of refactoring this code it is changed to call
> fh_fill_pre_attrs() once early on (so errors only need to be caught in
> one place) and then to use a new fh_fill_post_noop() when it is
> determined that no creation happened.
> 
> fh_fill_pre_attrs() now stores the attrs (which it had to get all of
> anyway)_ in ->fh_post_attr.  fh_fill_post_noop() simply marks them as
> valid.  fh_fill_post_attrs() replaces them.
> 
> This change involves moving fh_fill_pre_attrs() out of the inode_lock on
> the directory.  This means that we cannot provide "atomic" wcc data so a
> new fh_fill_pre_attrs_unlocked() is provided which marks the attrs as
> non-atomic.
> 
> This is unfortunate but inevitable if we are ever to allow concurrent
> updates in a directory (which can significantly improve performance in
> some cases).  To get atomic pre/post attributes we will need to be able
> to ask the fs to provide them, or to request a lease on the directory
> for the duration of an operation.
> 
> Note that we haven't provided pre/post attrs on WRITE requests for a
> long time for exactly this reason - we cannot lock the file to get them.
> 
> Signed-off-by: NeilBrown <neil@brown.name>
> ---
>  fs/nfsd/nfs4proc.c | 20 ++++++--------
>  fs/nfsd/nfsfh.c    | 69 +++++++++++++++++++++++-----------------------
>  fs/nfsd/nfsfh.h    | 14 +++++++++-
>  3 files changed, 56 insertions(+), 47 deletions(-)
> 

The loss of atomic post-op attrs is lamentable, but it is in service of
a higher cause!

Reviewed-by: Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2026-07-06 16:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-05 22:19 [PATCH v2 00/14] nfsd: refactor nfs4_create_file() NeilBrown
2026-07-05 22:19 ` [PATCH v2 01/14] nfsd: honour client-provided attributes for NFS4_CREATE_EXCLUSIVE4_1 NeilBrown
2026-07-06 16:14   ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 02/14] nfsd: replace fh_fill_both_attrs() with fh_fill_post_noop() NeilBrown
2026-07-06 16:15   ` Jeff Layton [this message]
2026-07-05 22:19 ` [PATCH v2 03/14] nfsd: move fh_want_write() after preamble in nfsd4_create_file() NeilBrown
2026-07-06 16:15   ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 04/14] nfsd: move more nfs-specific code into preamble of nfsd4_create_file() NeilBrown
2026-07-06 16:16   ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 05/14] nfsd: remove subtlety from nfsd4_create_file() NeilBrown
2026-07-06 16:16   ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 06/14] nfsd: in nfsd4_create_file() let VFS report if file was created NeilBrown
2026-07-06 15:52   ` Jeff Layton
2026-07-06 23:28     ` NeilBrown
2026-07-07 11:13       ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 07/14] nfsd: nfsd4_create_file(): Move NFSD_MAY_CREATE check earlier NeilBrown
2026-07-06 16:19   ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 08/14] nfsd: always open file in nfsd4_create_file() NeilBrown
2026-07-05 22:19 ` [PATCH v2 09/14] nfsd: reduce range of directory lock " NeilBrown
2026-07-06 16:21   ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 10/14] nfsd: open-code nfsd4_vfs_create() into nfsd4_create_file() NeilBrown
2026-07-06 16:21   ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 11/14] nfsd: move some code out of the d_really_is_negative() branch in nfsd4_create_file() NeilBrown
2026-07-06 16:23   ` Jeff Layton
2026-07-05 22:19 ` [PATCH v2 12/14] nfsd: reduce want-write range " NeilBrown
2026-07-05 22:19 ` [PATCH v2 13/14] nfsd: separate out VFS-specific from from nfsd4_create_file() NeilBrown
2026-07-06 16:00   ` Jeff Layton
2026-07-06 23:29     ` NeilBrown
2026-07-05 22:19 ` [PATCH v2 14/14] nfsd: use do_lookup_open() for non-creating open requests too NeilBrown
2026-07-06 14:36   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6b08d28b3e7b6ee3dbbb482a33d58c2bc420245.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.