Re: [PATCH 1/6] Change inode_operations.mkdir to return struct dentry *

2025-02-23 Thread NeilBrown
On Mon, 24 Feb 2025, Al Viro wrote: > On Mon, Feb 24, 2025 at 12:34:06PM +1100, NeilBrown wrote: > > On Sat, 22 Feb 2025, Al Viro wrote: > > > On Fri, Feb 21, 2025 at 10:36:30AM +1100, NeilBrown wrote: > > > > > > > +In general, filesystems which use d_instantiate_new() to install the > > > > new

Re: [PATCH 4/6] fuse: return correct dentry for ->mkdir

2025-02-23 Thread Al Viro
On Mon, Feb 24, 2025 at 01:26:18PM +1100, NeilBrown wrote: > Probably now. It would require S_IFDIR to be passed in the mode to > vfs_mknod(). I don't think any current callers do that, but I don't see > any code in vfs_mknod() to prevent it. Not allowed (and that's caller's responsibility to e

Re: [PATCH 6/6] VFS: Change vfs_mkdir() to return the dentry.

2025-02-23 Thread NeilBrown
On Sat, 22 Feb 2025, Chuck Lever wrote: > On 2/20/25 6:36 PM, NeilBrown wrote: ... > > + dchild = vfs_mkdir(&nop_mnt_idmap, dirp, dchild, iap->ia_mode); > > + if (IS_ERR(dchild)) { > > + host_err = PTR_ERR(dchild); > > + } else if (d_is_negative(dchil

Re: [PATCH 5/6] nfs: change mkdir inode_operation to return alternate dentry if needed.

2025-02-23 Thread NeilBrown
On Sat, 22 Feb 2025, Al Viro wrote: > On Fri, Feb 21, 2025 at 10:36:34AM +1100, NeilBrown wrote: > > > nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr > > *sattr) > > { > > struct posix_acl *default_acl, *acl; > > @@ -612,15 +612,18 @@ nfs3_proc_mkdir(struct inode *di

Re: [PATCH 4/6] fuse: return correct dentry for ->mkdir

2025-02-23 Thread NeilBrown
On Sat, 22 Feb 2025, Al Viro wrote: > On Fri, Feb 21, 2025 at 10:36:33AM +1100, NeilBrown wrote: > > > @@ -871,7 +870,12 @@ static int fuse_mknod(struct mnt_idmap *idmap, struct > > inode *dir, > > args.in_args[0].value = &inarg; > > args.in_args[1].size = entry->d_name.len + 1; > > a

Re: [PATCH 3/6] ceph: return the correct dentry on mkdir

2025-02-23 Thread NeilBrown
On Fri, 21 Feb 2025, Viacheslav Dubeyko wrote: > On Fri, 2025-02-21 at 10:36 +1100, NeilBrown wrote: > > ceph already splices the correct dentry (in splice_dentry()) from the > > result of mkdir but does nothing more with it. > > > > Now that ->mkdir can return a dentry, return the correct dentry.

Re: [PATCH 1/6] Change inode_operations.mkdir to return struct dentry *

2025-02-23 Thread Al Viro
On Mon, Feb 24, 2025 at 12:34:06PM +1100, NeilBrown wrote: > On Sat, 22 Feb 2025, Al Viro wrote: > > On Fri, Feb 21, 2025 at 10:36:30AM +1100, NeilBrown wrote: > > > > > +In general, filesystems which use d_instantiate_new() to install the new > > > +inode can safely return NULL. Filesystems whic

Re: [PATCH 1/6] Change inode_operations.mkdir to return struct dentry *

2025-02-23 Thread NeilBrown
On Sat, 22 Feb 2025, Al Viro wrote: > On Fri, Feb 21, 2025 at 10:36:30AM +1100, NeilBrown wrote: > > > +In general, filesystems which use d_instantiate_new() to install the new > > +inode can safely return NULL. Filesystems which may not have an I_NEW > > inode > > +should use d_drop();d_splice_