[SCM] Samba Shared Repository - branch v4-6-test updated
Karolin Seeger
kseeger at samba.org
Mon Jan 22 12:15:03 UTC 2018
The branch, v4-6-test has been updated
via 21d0446 vfs_default: use VFS statvfs macro in fs_capabilities
via a6b780c vfs_ceph: add fs_capabilities hook to avoid local statvfs
from 579b6a4 s3: smbd: Use identical logic to test for kernel oplocks on a share.
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-6-test
- Log -----------------------------------------------------------------
commit 21d0446c4811f2f066b549232ddd27b353a8c633
Author: David Disseldorp <ddiss at 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 <ddiss at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 4b25c9f4a4d336a16894452862ea059701b025de)
Autobuild-User(v4-6-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-6-test): Mon Jan 22 13:14:03 CET 2018 on sn-devel-144
commit a6b780c52b251505e50607d6f77f57330b830b00
Author: David Disseldorp <ddiss at 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 <ddiss at samba.org>
Reviewed-by: Jeremy Allison <jra at 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 e3d22bf..2842647 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -251,6 +251,20 @@ static int cephwrap_statvfs(struct vfs_handle_struct *handle, const char *path,
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,
@@ -1339,6 +1353,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 ce1b6e2..4889591 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -121,8 +121,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, conn->connectpath, &statbuf);
if (ret == 0) {
caps = statbuf.FsCapabilities;
}
@@ -132,12 +138,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
More information about the samba-cvs
mailing list