]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_ceph: explicit cast to uint64_t upon failure of ceph_statfs
authorShachar Sharon <ssharon@redhat.com>
Thu, 30 May 2024 08:02:37 +0000 (11:02 +0300)
committerAnoop C S <anoopcs@samba.org>
Thu, 27 Jun 2024 05:34:33 +0000 (05:34 +0000)
When a call to 'ceph_statfs' from with 'cephwrap_disk_free' returns
non-zero status do an explicit cast to uint64_t for the negative (-1)
value returned by 'status_code'.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/modules/vfs_ceph.c

index 425c623f343b685ac7ac0b04f9d27ca5a464f106..67ffe311a56bb4c3a6c33bca482d0f1416d04185 100644 (file)
@@ -349,7 +349,7 @@ static uint64_t cephwrap_disk_free(struct vfs_handle_struct *handle,
        ret = ceph_statfs(handle->data, smb_fname->base_name, &statvfs_buf);
        if (ret < 0) {
                DBG_DEBUG("[CEPH] ceph_statfs returned %d\n", ret);
-               return status_code(ret);
+               return (uint64_t)status_code(ret);
        }
        /*
         * Provide all the correct values.