The branch, master has been updated
       via  32cd874892d vfs_ceph_new: proper failure-handling in chdir and getwd
      from  512def68ed7 Georgian translation for tools

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 32cd874892d0fb4dded3282ce5a723e0cbb0f2df
Author: Shachar Sharon <[email protected]>
Date:   Wed Dec 3 11:39:51 2025 +0200

    vfs_ceph_new: proper failure-handling in chdir and getwd
    
    In case of an unlikely failure of SMB_VFS_HANDLE_GET_DATA macro, bail
    out using 'goto' in order to ensure that START_PROFILE_X is properly
    matched by END_PROFILE_X.
    
    Signed-off-by: Shachar Sharon <[email protected]>
    Reviewed-by: John Mulligan <[email protected]>
    Reviewed-by: Anoop C S <[email protected]>
    
    Autobuild-User(master): Anoop C S <[email protected]>
    Autobuild-Date(master): Thu Dec  4 10:02:55 UTC 2025 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_ceph_new.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_ceph_new.c b/source3/modules/vfs_ceph_new.c
index d0f35affac7..1ef3ca3714a 100644
--- a/source3/modules/vfs_ceph_new.c
+++ b/source3/modules/vfs_ceph_new.c
@@ -3408,16 +3408,18 @@ out:
 static int vfs_ceph_chdir(struct vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname)
 {
-       int result = -1;
+       int result = -ENOMEM;
        struct vfs_ceph_config *config = NULL;
 
        START_PROFILE_X(SNUM(handle->conn), syscall_chdir);
+
        SMB_VFS_HANDLE_GET_DATA(handle, config, struct vfs_ceph_config,
-                               return -ENOMEM);
+                               goto out);
 
        DBG_DEBUG("[CEPH] chdir: handle=%p name=%s\n", handle, 
smb_fname->base_name);
        result = config->ceph_chdir_fn(config->mount, smb_fname->base_name);
        DBG_DEBUG("[CEPH] chdir: name=%s result=%d\n", smb_fname->base_name, 
result);
+out:
        END_PROFILE_X(syscall_chdir);
        return status_code(result);
 }
@@ -3427,15 +3429,18 @@ static struct smb_filename *vfs_ceph_getwd(struct 
vfs_handle_struct *handle,
 {
        const char *cwd = NULL;
        struct vfs_ceph_config *config = NULL;
+       struct smb_filename *result = NULL;
 
        START_PROFILE_X(SNUM(handle->conn), syscall_getwd);
        SMB_VFS_HANDLE_GET_DATA(handle, config, struct vfs_ceph_config,
-                               return NULL);
+                               goto out);
 
        cwd = config->ceph_getcwd_fn(config->mount);
        DBG_DEBUG("[CEPH] getwd: handle=%p cwd=%s\n", handle, cwd);
+       result = cp_smb_basename(ctx, cwd);
+out:
        END_PROFILE_X(syscall_getwd);
-       return cp_smb_basename(ctx, cwd);
+       return result;
 }
 
 static int strict_allocate_ftruncate(struct vfs_handle_struct *handle,


-- 
Samba Shared Repository

Reply via email to