vfs_ceph: fix cephwrap_chdir()
authorDavid Disseldorp <ddiss@samba.org>
Fri, 14 Jul 2017 21:55:29 +0000 (23:55 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Fri, 21 Jul 2017 17:10:46 +0000 (19:10 +0200)
When provided a '/' path (i.e. CephFS root), vfs_ceph does a *local*
chdir() to the share path. This breaks smb client directory listings.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12911

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Jul 21 19:10:46 CEST 2017 on sn-devel-144

source3/modules/vfs_ceph.c

index 73106c4ac604fcda3e9bd116a0ad18358244894d..9abd32196a812bd7b5e55277a5dff5288c5b4ef2 100644 (file)
@@ -936,14 +936,6 @@ static int cephwrap_chdir(struct vfs_handle_struct *handle,
 {
        int result = -1;
        DBG_DEBUG("[CEPH] chdir(%p, %s)\n", handle, smb_fname->base_name);
-       /*
-        * If the path is just / use chdir because Ceph is below / and
-        * cannot deal with changing directory above its mount point
-        */
-       if (!strcmp(smb_fname->base_name, "/")) {
-               return chdir(smb_fname->base_name);
-       }
-
        result = ceph_chdir(handle->data, smb_fname->base_name);
        DBG_DEBUG("[CEPH] chdir(...) = %d\n", result);
        WRAP_RETURN(result);