vfs_ceph: drop fdopendir handler
authorDavid Disseldorp <ddiss@samba.org>
Wed, 27 Mar 2019 12:10:04 +0000 (13:10 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Tue, 14 May 2019 22:17:32 +0000 (22:17 +0000)
libcephfs doesn't currently offer an fdopendir equivalent, so the
existing implementation peeks at fsp->fsp_name->base_name, which can
break if vfs_ceph is used under a separate path-munging VFS module.

Return ENOSYS instead and rely on existing OpenDir_fsp() fallback.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_ceph.c

index 6f29629566e8c082e67b9c1cd6a395d59c2c342e..e1f3d757bf1240953b14e4e7840cbb80b3f49af4 100644 (file)
@@ -328,18 +328,9 @@ static DIR *cephwrap_fdopendir(struct vfs_handle_struct *handle,
                               const char *mask,
                               uint32_t attributes)
 {
-       int ret = 0;
-       struct ceph_dir_result *result;
-       DBG_DEBUG("[CEPH] fdopendir(%p, %p)\n", handle, fsp);
-
-       ret = ceph_opendir(handle->data, fsp->fsp_name->base_name, &result);
-       if (ret < 0) {
-               result = NULL;
-               errno = -ret; /* We return result which is NULL in this case */
-       }
-
-       DBG_DEBUG("[CEPH] fdopendir(...) = %d\n", ret);
-       return (DIR *) result;
+       /* OpenDir_fsp() falls back to regular open */
+       errno = ENOSYS;
+       return NULL;
 }
 
 static struct dirent *cephwrap_readdir(struct vfs_handle_struct *handle,