]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ceph: return the correct dentry on mkdir
authorNeilBrown <neilb@suse.de>
Thu, 27 Feb 2025 01:32:55 +0000 (12:32 +1100)
committerChristian Brauner <brauner@kernel.org>
Thu, 27 Feb 2025 19:00:17 +0000 (20:00 +0100)
commit3f92c7b57687fb24da46487d91dba7aa58aed75b
tree50ee1f9bb1142fe2ce8929bd12aa9ae0b8a1f1e5
parent3f90030e121201cb274cc4754d7be23099180d25
ceph: return the correct dentry on mkdir

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.

Note that previously ceph_mkdir() could call
   ceph_init_inode_acls()
on the inode from the wrong dentry, which 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 <Slava.Dubeyko@ibm.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Link: https://lore.kernel.org/r/20250227013949.536172-4-neilb@suse.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/ceph/dir.c