]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Revert "vfs_ceph: drop fdopendir handler"
authorDavid Disseldorp <ddiss@samba.org>
Mon, 5 Oct 2020 10:28:27 +0000 (12:28 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Mon, 5 Oct 2020 12:38:34 +0000 (12:38 +0000)
This reverts commit 76d7d05b1da6c0703b1c2bade0c4467c7cc1adec.
OpenDir_fsp() no longer falls back to regular open, so this hook is
required.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Mon Oct  5 12:38:34 UTC 2020 on sn-devel-184

source3/modules/vfs_ceph.c

index 0378d633782a5543932b7d87a719bc409daa15e1..a87d162e5736f4e04aa2e8b3239c22626a35959f 100644 (file)
@@ -306,9 +306,18 @@ static DIR *cephwrap_fdopendir(struct vfs_handle_struct *handle,
                               const char *mask,
                               uint32_t attributes)
 {
-       /* OpenDir_fsp() falls back to regular open */
-       errno = ENOSYS;
-       return NULL;
+       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;
 }
 
 static struct dirent *cephwrap_readdir(struct vfs_handle_struct *handle,