Re: [PATCH 0/3} Change ->mkdir() and vfs_mkdir() to return a dentry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 14, 2025 at 06:13:55AM +0000, Al Viro wrote:
> On Fri, Feb 14, 2025 at 06:00:39AM +0000, Al Viro wrote:
> 
> > 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.
> 
> Definitely so: in cifs_mkdir() we have
>         if ((server->ops->posix_mkdir) && (tcon->posix_extensions)) {
>                 rc = server->ops->posix_mkdir(xid, inode, mode, tcon, full_path,
>                                               cifs_sb);
>                 d_drop(direntry); /* for time being always refresh inode info */
>                 goto mkdir_out;
>         }
> There might be other cases.  hostfs is definitely like that, I'm pretty
> sure that kernfs is as well...

kernfs is actually playing fast and loose with the calling conventions there;
it does not bother with unhashing and relies upon its ->d_revalidate()
noticing and unhashing the sucker.

Another variant that would work (and follow the calling conventions)
is to have ->lookup() that leaves negatives unhashed and ->mkdir()
not bothering to hash or instantiate.

It really needs a review instance by instance.

And yes, it does look like ->lookup()-like calling conventions end up better,
especially if we make an instance return d_splice_alias() result...




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux