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

2025-03-04 Thread NeilBrown
the result. Reviewed-by: Jeff Layton Signed-off-by: NeilBrown --- fs/fuse/dir.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) Thanks for the suggestion Miklos - this looks much better. Christian: could you please replace the fuse patch i

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

2025-02-26 Thread NeilBrown
) the original dentry is put. Reviewed-by: Jeff Layton Signed-off-by: NeilBrown --- drivers/base/devtmpfs.c | 7 +++ fs/cachefiles/namei.c| 16 +++--- fs/ecryptfs/inode.c | 14 + fs/init.c| 7 +-- fs/namei.c | 45

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

2025-02-26 Thread NeilBrown
inode_operation. nfs4_do_create() is duplicated to nfs4_do_mkdir() which is changed to handle the specifics of directories. Consequently the current special handling for directories is removed from nfs4_do_create() Reviewed-by: Jeff Layton Signed-off-by: NeilBrown --- fs/nfs/dir.c| 13

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

2025-02-26 Thread NeilBrown
is asked to create anything other than a directory we can be sure it will NOT return an alternate dentry as d_splice_alias() only returns an alternate dentry for directories. So we don't need to check for that case when passing one the result. Reviewed-by: Jeff Layton Signed-off-by: NeilBrown

[PATCH 2/6] hostfs: store inode in dentry after mkdir if possible.

2025-02-26 Thread NeilBrown
After handling a mkdir, get the inode for the name and use d_splice_alias() to store the correct dentry in the dcache. Reviewed-by: Jeff Layton Signed-off-by: NeilBrown --- fs/hostfs/hostfs_kern.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/hostfs

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

2025-02-26 Thread NeilBrown
ich would be NULL. This is safe as ceph_init_inode_acls() checks for NULL, but is not strictly correct. With this patch, the inode for the returned dentry is passed to ceph_init_inode_acls(). Reviewed-by: Viacheslav Dubeyko Signed-off-by: NeilBrown --- fs/ceph/dir.c | 24

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

2025-02-26 Thread NeilBrown
t fits with current practice. A planned future patch will change this. Reviewed-by: Jeff Layton Reviewed-by: Jan Kara (VFS, ext2, ext4, ocfs2, udf) Signed-off-by: NeilBrown --- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/porting.rst | 19 +++ Do

[PATCH 0/6 v2] Change ->mkdir() and vfs_mkdir() to return a dentry

2025-02-26 Thread NeilBrown
correctly. I haven't tried to address those here, (this patch set doesn't make that situation any worse) but I may in the future. Thanks, NeilBrown [PATCH 1/6] Change inode_operations.mkdir to return struct dentry * [PATCH 2/6] hostfs: store inode in dentry after mkdir if possible.

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

2025-02-25 Thread NeilBrown
On Wed, 26 Feb 2025, Trond Myklebust wrote: > On Wed, 2025-02-26 at 13:09 +1100, NeilBrown wrote: > > On Tue, 25 Feb 2025, Trond Myklebust wrote: > > > On Mon, 2025-02-24 at 14:09 +1100, NeilBrown wrote: > > > > On Mon, 24 Feb 2025, Al Viro wrote: > > > >

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

2025-02-25 Thread NeilBrown
On Tue, 25 Feb 2025, Trond Myklebust wrote: > On Mon, 2025-02-24 at 14:09 +1100, NeilBrown wrote: > > 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: > > > >

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

2025-02-24 Thread NeilBrown
On Tue, 25 Feb 2025, Viacheslav Dubeyko wrote: > On Mon, 2025-02-24 at 13:15 +1100, NeilBrown wrote: > > 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

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

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); > > +

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 +61

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_ar

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 den

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 > > inod

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

2025-02-20 Thread NeilBrown
inode_operation. Reviewed-by: Jeff Layton Signed-off-by: NeilBrown --- fs/nfs/dir.c| 13 - fs/nfs/nfs3proc.c | 9 ++--- fs/nfs/nfs4proc.c | 43 + fs/nfs/proc.c | 12 include/linux/nfs_xdr.h | 2

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

2025-02-20 Thread NeilBrown
) the original dentry is put. Signed-off-by: NeilBrown --- drivers/base/devtmpfs.c | 7 +++--- fs/cachefiles/namei.c| 16 -- fs/ecryptfs/inode.c | 14 fs/init.c| 7 -- fs/namei.c | 46 ++-- f

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

2025-02-20 Thread NeilBrown
fuse already uses d_splice_alias() to ensure an appropriate dentry is found for a newly created dentry. Now that ->mkdir can return that dentry we do so. This requires changing create_new_entry() to return a dentry and handling that change in all callers. Signed-off-by: NeilBrown --- fs/f

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

2025-02-20 Thread NeilBrown
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. Signed-off-by: NeilBrown --- fs/ceph/dir.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) d

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

2025-02-20 Thread NeilBrown
and the ->revalidate operation ensures that lookup will be called to correctly populate the dentry. This could be fixed but I don't think it is important to any of the users of vfs_mkdir() which look at the dentry. Reviewed-by: Jeff Layton Reviewed-by: Jan Kara (VFS, ext2, ex

[PATCH 2/6] hostfs: store inode in dentry after mkdir if possible.

2025-02-20 Thread NeilBrown
After handling a mkdir, get the inode for the name and use d_splice_alias() to store the correct dentry in the dcache. Signed-off-by: NeilBrown --- fs/hostfs/hostfs_kern.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs

[PATCH 0/6] Change ->mkdir() and vfs_mkdir() to return a dentry.

2025-02-20 Thread NeilBrown
try sometimes, and changes the callers of vfs_mkdir() to use the returned dentry. I think it best if this could all land through the VFS tree as ask maitainers of: cachefiles nfsd smb/server hostfs ceph nfs fuse to provide a Reviewed-by. Thanks, NeilBrown