The branch, v4-7-test has been updated
       via  bde3d64 vfs_default: use VFS statvfs macro in fs_capabilities
       via  da6ee0c vfs_ceph: add fs_capabilities hook to avoid local statvfs
      from  d251dcc selftest: allow more time for tests

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit bde3d6402e6424015089fe3a2887c72eee45144f
Author: David Disseldorp <dd...@samba.org>
Date:   Wed Jan 10 14:03:09 2018 +0100

    vfs_default: use VFS statvfs macro in fs_capabilities
    
    Currently the vfs_default fs_capabilities handler calls statvfs
    directly, rather than calling the vfs macro. This behaviour may cause
    issues for VFS modules that delegate fs_capabilities handling to
    vfs_default but offer their own statvfs hook.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208
    
    Signed-off-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    (cherry picked from commit 4b25c9f4a4d336a16894452862ea059701b025de)
    
    Autobuild-User(v4-7-test): Karolin Seeger <ksee...@samba.org>
    Autobuild-Date(v4-7-test): Mon Jan 22 13:48:30 CET 2018 on sn-devel-144

commit da6ee0cf34af010d0796abddd06c83887e61c88e
Author: David Disseldorp <dd...@samba.org>
Date:   Wed Jan 10 01:37:14 2018 +0100

    vfs_ceph: add fs_capabilities hook to avoid local statvfs
    
    Adding the fs_capabilities() hook to the CephFS VFS module avoids
    fallback to the vfs_default code-path, which calls statvfs() against the
    share path on the *local* filesystem.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208
    
    Signed-off-by: David Disseldorp <dd...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    (cherry picked from commit 2724e0cac29cd1632ea28075a740fcc888affb36)

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

Summary of changes:
 source3/modules/vfs_ceph.c    | 15 +++++++++++++++
 source3/modules/vfs_default.c | 14 +++++++-------
 2 files changed, 22 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 9abd321..f482a8b 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -270,6 +270,20 @@ static int cephwrap_statvfs(struct vfs_handle_struct 
*handle,
        return ret;
 }
 
+static uint32_t cephwrap_fs_capabilities(struct vfs_handle_struct *handle,
+                                        enum timestamp_set_resolution 
*p_ts_res)
+{
+       uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+
+#ifdef HAVE_CEPH_STATX
+       *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+#else
+       *p_ts_res = TIMESTAMP_SET_MSEC;
+#endif
+
+       return caps;
+}
+
 /* Directory operations */
 
 static DIR *cephwrap_opendir(struct vfs_handle_struct *handle,
@@ -1399,6 +1413,7 @@ static struct vfs_fn_pointers ceph_fns = {
        .get_quota_fn = cephwrap_get_quota,
        .set_quota_fn = cephwrap_set_quota,
        .statvfs_fn = cephwrap_statvfs,
+       .fs_capabilities_fn = cephwrap_fs_capabilities,
 
        /* Directory operations */
 
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 53d9785..6686303 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -129,8 +129,14 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
        struct vfs_statvfs_struct statbuf;
        int ret;
 
+       smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
+                                             NULL, NULL, 0);
+       if (smb_fname_cpath == NULL) {
+               return caps;
+       }
+
        ZERO_STRUCT(statbuf);
-       ret = sys_statvfs(conn->connectpath, &statbuf);
+       ret = SMB_VFS_STATVFS(conn, smb_fname_cpath, &statbuf);
        if (ret == 0) {
                caps = statbuf.FsCapabilities;
        }
@@ -140,12 +146,6 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
        /* Work out what timestamp resolution we can
         * use when setting a timestamp. */
 
-       smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
-                                             NULL, NULL, 0);
-       if (smb_fname_cpath == NULL) {
-               return caps;
-       }
-
        ret = SMB_VFS_STAT(conn, smb_fname_cpath);
        if (ret == -1) {
                TALLOC_FREE(smb_fname_cpath);


-- 
Samba Shared Repository

Reply via email to