public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: NeilBrown <neilb@suse.de>
Cc: Christian Brauner <brauner@kernel.org>,
	Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3} Change ->mkdir() and vfs_mkdir() to return a dentry
Date: Fri, 14 Feb 2025 06:00:39 +0000	[thread overview]
Message-ID: <20250214060039.GB1977892@ZenIV> (raw)
In-Reply-To: <20250214052204.3105610-1-neilb@suse.de>

On Fri, Feb 14, 2025 at 04:16:40PM +1100, NeilBrown wrote:
> This is a small set of patches which are needed before we can make the
> locking on directory operations more fine grained.  I think they are
> useful even if we don't go that direction.
> 
> Some callers of vfs_mkdir() need to operation on the resulting directory
> but cannot be guaranteed that the dentry will be hashed and positive on
> success - another dentry might have been used.
> 
> This patch changes ->mkdir to return a dentry, changes NFS in particular
> to return the correct dentry (I believe it is the only filesystem to
> possibly not use the given dentry), and changes vfs_mkdir() to return
> that dentry, removing the look that a few callers currently need.
> 
> I have not Cc: the developers of all the individual filesystems - only
> NFS.  I have build-tested all the changes except hostfs.  I can email
> them explicitly if/when this is otherwise acceptable.  If anyone sees
> this on fs-devel and wants to provide a pre-emptive ack I will collect
> those and avoid further posting for those fs.

1) please, don't sprinkle the PTR_ERR_OR_ZERO() shite all over the place.
Almost always the same thing can be done without it and it ends up
being cleaner.  Seriously.

2) I suspect that having method instances return NULL for "just use the
argument" would would be harder to fuck up; basically, the same as for
->lookup() instances.  I'll try to tweak it and see what falls out...

3) I'm pretty sure that NFS is *not* the only filesystem that returns
unhashed negative in some success cases; will need to go over the instances
to verify that, though.

  parent reply	other threads:[~2025-02-14  6:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14  5:16 [PATCH 0/3} Change ->mkdir() and vfs_mkdir() to return a dentry NeilBrown
2025-02-14  5:16 ` [PATCH 1/3] Change inode_operations.mkdir to return struct dentry * NeilBrown
2025-02-15  8:09   ` kernel test robot
2025-02-17 15:58   ` kernel test robot
2025-02-14  5:16 ` [PATCH 2/3] nfs: change mkdir inode_operation to return alternate dentry if needed NeilBrown
2025-02-14  5:16 ` [PATCH 3/3] VFS: Change vfs_mkdir() to return the dentry NeilBrown
2025-02-15  4:10   ` kernel test robot
2025-02-15  6:36   ` kernel test robot
2025-02-14  6:00 ` Al Viro [this message]
2025-02-14  6:13   ` [PATCH 0/3} Change ->mkdir() and vfs_mkdir() to return a dentry Al Viro
2025-02-14  6:33     ` Al Viro
2025-02-17  3:53   ` NeilBrown

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=20250214060039.GB1977892@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=anna@kernel.org \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=trondmy@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox