[PATCH 3/6] ceph: return the correct dentry on mkdir
Christian Brauner
brauner at kernel.org
Thu Feb 27 11:01:39 PST 2025
On Thu, Feb 27, 2025 at 12:32:55PM +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.
>
> 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 at ibm.com>
> Signed-off-by: NeilBrown <neilb at suse.de>
> ---
> fs/ceph/dir.c | 24 ++++++++++++++++--------
> 1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> index 39e0f240de06..5e98394e2dca 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -1099,6 +1099,7 @@ static struct dentry *ceph_mkdir(struct mnt_idmap *idmap, struct inode *dir,
> struct ceph_client *cl = mdsc->fsc->client;
> struct ceph_mds_request *req;
> struct ceph_acl_sec_ctx as_ctx = {};
> + struc dentry *ret;
Forgot to mention that I fixed this when I applied.
More information about the linux-um
mailing list