]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_ceph_new: avoid iref leak due to failure in ceph_ll_link
authorShachar Sharon <ssharon@redhat.com>
Sun, 22 Mar 2026 17:50:16 +0000 (19:50 +0200)
committerAnoop C S <anoopcs@samba.org>
Thu, 26 Mar 2026 08:20:36 +0000 (08:20 +0000)
Even in cases where vfs_ceph_ll_link fails, we need to do iput in order
to decrement inode's ref-count.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
source3/modules/vfs_ceph_new.c

index 960dfd8db812bbb2e24edfb1f3e6df3f97041a5a..a553508a37de010c786da104c2bd1c3e21c4e8c7 100644 (file)
@@ -4107,10 +4107,6 @@ static int vfs_ceph_linkat(struct vfs_handle_struct *handle,
        }
 
        result = vfs_ceph_ll_link(handle, dst_dircfh, newname, &iref);
-       if (result != 0) {
-               goto out;
-       }
-
        vfs_ceph_iput(handle, &iref);
 out:
        DBG_DEBUG("[CEPH] link done: result=%d\n", result);