The branch, v4-21-test has been updated
via 6533b3db6ce vfs_ceph_new: detect case sensitivity in CephFS
via f57377d1b9c vfs_glusterfs: Retrieve fs capabilities using
vfs_get_fs_capabilities
via 2a70febce8a vfs_ceph_new: Retrieve fs capabilties using
vfs_get_fs_capabilities
via 32e6aefa86d vfs_ceph_new: Populate fs capabilities within
vfs_ceph_statvfs
via 3b5c47c40f2 vfs_ceph: Retrieve fs capabilties using
vfs_get_fs_capabilities
via 78ab723ea2b vfs_ceph: Populate fs capabilities within
cephwrap_statvfs
via 904341acc5f vfs_default: Retrieve fs capabilites using
vfs_get_fs_capabilties
via 8c7d9f39d9f s3/smbd: Add a helper to fetch fs capabilities
via 37a74eb39a9 smbd: consolidate fs capabilities code in
vfswrap_fs_capabilities()
from 40d2b73f24b vfs_ceph_new: Do not resolve by inode number
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-21-test
- Log -----------------------------------------------------------------
commit 6533b3db6cecdd41f19ab2d0a8b51f6cbecd759c
Author: Xavi Hernandez <[email protected]>
Date: Tue Mar 4 12:48:41 2025 +0100
vfs_ceph_new: detect case sensitivity in CephFS
CephFS has recently added support for case insensitive access to the
file system. This modification detects whether the shared volume is case
sensitive or not and reports the FILE_CASE_SENSITIVE_SEARCH capability
accordingly.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Xavi Hernandez <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
Reviewed-by: Guenther Deschner <[email protected]>
Autobuild-User(master): Günther Deschner <[email protected]>
Autobuild-Date(master): Tue Mar 11 20:34:26 UTC 2025 on atb-devel-224
(cherry picked from commit a52602030e6ba0e1bcddf5f611464b58076fadd0)
Autobuild-User(v4-21-test): Jule Anger <[email protected]>
Autobuild-Date(v4-21-test): Thu Mar 20 11:09:15 UTC 2025 on atb-devel-224
commit f57377d1b9c05d79d8c18d0cd1ce1ba03cde6bd0
Author: Anoop C S <[email protected]>
Date: Tue Sep 17 23:58:50 2024 +0530
vfs_glusterfs: Retrieve fs capabilities using vfs_get_fs_capabilities
vfs_glusterfs is supposed to be the last entry when listed with
other vfs modules. This is due to the fact that the connection path
is not local to the server but relative to the virtual remote file
system beneath it. Especially SMB_VFS_FS_CAPABILITIES implementation
from vfs_default is likely to return incorrect results based on the
connection path assumed to be local to the server which might not be
the case with glusterfs module stacked. Therefore it doesn't make sense
to pass through any vfs interface implementations further down the line
to vfs_default.
Instead make use of get_fs_capabilties to start with already known fs
capabilties from connect phase.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Anoop C S <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
Autobuild-User(master): Ralph Böhme <[email protected]>
Autobuild-Date(master): Mon Oct 7 13:36:11 UTC 2024 on atb-devel-224
(cherry picked from commit 3c6ca81aad16e74bc3d9c4784baf97a237f652c6)
commit 2a70febce8a59a688415869ba017e0775a6fed2e
Author: Anoop C S <[email protected]>
Date: Thu Oct 3 12:32:04 2024 +0530
vfs_ceph_new: Retrieve fs capabilties using vfs_get_fs_capabilities
Make use of get_fs_capabilties to start with already known fs
capabilties from connect phase.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Anoop C S <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
(cherry picked from commit 9524b402f811fd2fc35c9952df0496898f8e2cbe)
commit 32e6aefa86d9e1dc0f4520d01eb59a18c54fbf5a
Author: Anoop C S <[email protected]>
Date: Thu Oct 3 12:29:58 2024 +0530
vfs_ceph_new: Populate fs capabilities within vfs_ceph_statvfs
SMB_VFS_STATVFS implementation for vfs_ceph_new failed to fill in the
FsCapabilities field for vfs_statvfs_struct. Insert the minimum
required values for defining the capabilties of a ceph file system.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Anoop C S <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
(cherry picked from commit 58cf7a63209b0a898bc39c9f8b7de5188bef618f)
commit 3b5c47c40f2b0b23e35f4b0270b9323d6becf418
Author: Anoop C S <[email protected]>
Date: Tue Sep 17 23:50:25 2024 +0530
vfs_ceph: Retrieve fs capabilties using vfs_get_fs_capabilities
vfs_ceph is supposed to be the last entry when listed with other vfs
modules. This is due to the fact that the connection path is not local
to the server but relative to the virtual remote file system beneath
it. Especially SMB_VFS_FS_CAPABILITIES implementation from vfs_default
is likely to return incorrect results based on the connection path
assumed to be local to the server which might not be the case with
ceph module stacked. Therefore it doesn't make sense to pass through
any vfs interface implementations further down the line to vfs_default.
Instead make use of get_fs_capabilties to start with already known fs
capabilties from connect phase.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Anoop C S <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
(cherry picked from commit 44e4e1eade5cadea9bd93fde8293ab6eb26230cc)
commit 78ab723ea2b24e0fd7d93ee49c5df6b0df1b2a00
Author: Anoop C S <[email protected]>
Date: Mon Sep 23 14:55:59 2024 +0530
vfs_ceph: Populate fs capabilities within cephwrap_statvfs
SMB_VFS_STATVFS implementation for vfs_ceph failed to fill in the
FsCapabilities field for vfs_statvfs_struct. Insert the minimum
required values for defining the capabilties of a ceph file system.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Anoop C S <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
(cherry picked from commit 0d922d06a71ad647791cd93194c5591033fc4b4b)
commit 904341acc5f966d60f262193919aa182ec105466
Author: Anoop C S <[email protected]>
Date: Tue Sep 24 11:25:54 2024 +0530
vfs_default: Retrieve fs capabilites using vfs_get_fs_capabilties
Make use of get_fs_capabilties to start with already known fs
capabilties from connect phase.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Anoop C S <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
(cherry picked from commit 9bced4429e90ba871b848f31738aa8614bf03b08)
commit 8c7d9f39d9fca3d846cc3a8f348af3788c25fd0d
Author: Anoop C S <[email protected]>
Date: Tue Sep 24 11:06:58 2024 +0530
s3/smbd: Add a helper to fetch fs capabilities
We create a new helper function to retrieve the fs capabilties via
STATVFS call. Additionally set other capabilities based on specific
parametric options. This is 99.9% taken from SMB_VFS_FS_CAPABILITIES
implementation of vfs_default in preparation to be called from any
required vfs module.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Anoop C S <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
(cherry picked from commit b1fbaefc665a7fb0413a26bd0304f97356fda414)
commit 37a74eb39a94aa54ec6d2262b1a7ca8016c5a2a2
Author: Ralph Boehme <[email protected]>
Date: Thu Jun 6 15:38:16 2024 +0200
smbd: consolidate fs capabilities code in vfswrap_fs_capabilities()
This ensures the values we return via SMB_FS_ATTRIBUTE_INFORMATION is the
same
we use internally via conn->fs_capabilities.
This deliberately preserves existing behaviour as much as possible and
leaves
possible improvements as a future excercize. Particularily
FILE_VOLUME_QUOTAS is
already set insided SMB_VFS_STATVFS() depending on backend filesystem flags
which is probably the correct way to do it instead of just setting the
capability when Samba was built with quota support.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15822
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: David Disseldorp <[email protected]>
(cherry picked from commit deeca8ff176e7e9082cc0fcf48d7f981de2523c5)
-----------------------------------------------------------------------
Summary of changes:
source3/modules/vfs_ceph.c | 7 ++--
source3/modules/vfs_ceph_new.c | 87 +++++++++++++++++++++++++++++++++++++++--
source3/modules/vfs_default.c | 61 ++---------------------------
source3/modules/vfs_glusterfs.c | 6 +--
source3/smbd/proto.h | 2 +
source3/smbd/smb2_trans2.c | 18 +--------
source3/smbd/vfs.c | 72 ++++++++++++++++++++++++++++++++++
7 files changed, 167 insertions(+), 86 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index fd450af16c2..a72061d5d9d 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -363,6 +363,9 @@ static int cephwrap_statvfs(struct vfs_handle_struct
*handle,
statbuf->TotalFileNodes = statvfs_buf.f_files;
statbuf->FreeFileNodes = statvfs_buf.f_ffree;
statbuf->FsIdentifier = statvfs_buf.f_fsid;
+ statbuf->FsCapabilities =
+ FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+
DBG_DEBUG("[CEPH] f_bsize: %ld, f_blocks: %ld, f_bfree: %ld, "
"f_bavail: %ld\n",
(long int)statvfs_buf.f_bsize,
@@ -377,9 +380,7 @@ 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;
-
- *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+ uint32_t caps = vfs_get_fs_capabilities(handle->conn, p_ts_res);
return caps;
}
diff --git a/source3/modules/vfs_ceph_new.c b/source3/modules/vfs_ceph_new.c
index 8b051e0f226..dd7acbf1575 100644
--- a/source3/modules/vfs_ceph_new.c
+++ b/source3/modules/vfs_ceph_new.c
@@ -113,6 +113,15 @@ struct vfs_ceph_config {
enum vfs_cephfs_proxy_mode proxy;
void *libhandle;
+ /*
+ * This field stores the Samba capabilities for the share represented
+ * by this struct. The share capabilities are computed once during the
+ * module startup and then cached here for future references.
+ *
+ * It's completely independent of the CephFS capabilities concept.
+ */
+ uint32_t capabilities;
+
CEPH_FN(ceph_ll_walk);
CEPH_FN(ceph_ll_getattr);
CEPH_FN(ceph_ll_setattr);
@@ -1932,12 +1941,79 @@ static uint64_t vfs_ceph_disk_free(struct
vfs_handle_struct *handle,
return *dfree;
}
+static int vfs_ceph_check_case_sensitivity(struct vfs_handle_struct *handle,
+ uint32_t *capabilities)
+{
+ struct vfs_ceph_iref iref = {0};
+ char value[8] = {0};
+ struct vfs_ceph_config *config = NULL;
+ uint32_t caps;
+ int ret;
+
+ SMB_VFS_HANDLE_GET_DATA(handle, config, struct vfs_ceph_config,
+ return -ENOMEM);
+
+ if (config->capabilities != 0) {
+ *capabilities = config->capabilities;
+ return 0;
+ }
+
+ /*
+ * In CephFS, case sensitivity configuration is inherited by default,
+ * but it can be manually overridden by an administrator. Samba assumes
+ * that all directories inherit the configuration from the root of the
+ * share and the administrator doesn't change it manually.
+ */
+ ret = vfs_ceph_iget(handle, handle->conn->connectpath, 0, &iref);
+ if (ret != 0) {
+ return ret;
+ }
+
+ caps = FILE_CASE_PRESERVED_NAMES;
+
+ ret = vfs_ceph_ll_getxattr(handle, &iref, "ceph.dir.casesensitive",
+ value, sizeof(value) - 1);
+ if (ret < 0) {
+ if (ret != -ENODATA) {
+ DBG_ERR("[CEPH] failed to get case sensitivity "
+ "settings: path='%s' %s",
+ handle->conn->connectpath, strerror(-ret));
+ goto out;
+ }
+
+ /*
+ * The xattr is not defined, so the filesystem is case sensitive
+ * by default.
+ */
+ caps |= FILE_CASE_SENSITIVE_SEARCH;
+ } else {
+ /*
+ * We only accept "0" as 'false' (as defined in the CephFS
+ * documentation). All other values are interpreted as 'true'
+ */
+ if (strcmp(value, "0") != 0) {
+ caps |= FILE_CASE_SENSITIVE_SEARCH;
+ }
+ }
+
+ config->capabilities = caps;
+ *capabilities = caps;
+
+ ret = 0;
+
+out:
+ vfs_ceph_iput(handle, &iref);
+
+ return ret;
+}
+
static int vfs_ceph_statvfs(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
struct vfs_statvfs_struct *statbuf)
{
struct statvfs statvfs_buf = { 0 };
struct vfs_ceph_iref iref = {0};
+ uint32_t caps = 0;
int ret;
ret = vfs_ceph_iget(handle, smb_fname->base_name, 0, &iref);
@@ -1950,6 +2026,11 @@ static int vfs_ceph_statvfs(struct vfs_handle_struct
*handle,
goto out;
}
+ ret = vfs_ceph_check_case_sensitivity(handle, &caps);
+ if (ret < 0) {
+ goto out;
+ }
+
statbuf->OptimalTransferSize = statvfs_buf.f_frsize;
statbuf->BlockSize = statvfs_buf.f_bsize;
statbuf->TotalBlocks = statvfs_buf.f_blocks;
@@ -1958,6 +2039,8 @@ static int vfs_ceph_statvfs(struct vfs_handle_struct
*handle,
statbuf->TotalFileNodes = statvfs_buf.f_files;
statbuf->FreeFileNodes = statvfs_buf.f_ffree;
statbuf->FsIdentifier = statvfs_buf.f_fsid;
+ statbuf->FsCapabilities = caps;
+
DBG_DEBUG("[CEPH] f_bsize: %ld, f_blocks: %ld, f_bfree: %ld, "
"f_bavail: %ld\n",
(long int)statvfs_buf.f_bsize,
@@ -1973,9 +2056,7 @@ static uint32_t vfs_ceph_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;
-
- *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+ uint32_t caps = vfs_get_fs_capabilities(handle->conn, p_ts_res);
return caps;
}
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index e0ebc7bd1a2..360a78c17e2 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -153,67 +153,12 @@ static int vfswrap_statvfs(struct vfs_handle_struct
*handle,
static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle,
enum timestamp_set_resolution *p_ts_res)
{
- const struct loadparm_substitution *lp_sub =
- loadparm_s3_global_substitution();
- connection_struct *conn = handle->conn;
- uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
- struct smb_filename *smb_fname_cpath = NULL;
- struct vfs_statvfs_struct statbuf;
- int ret;
-
- smb_fname_cpath = synthetic_smb_fname(talloc_tos(),
- conn->connectpath,
- NULL,
- NULL,
- 0,
- 0);
- if (smb_fname_cpath == NULL) {
- return caps;
- }
-
- ZERO_STRUCT(statbuf);
- ret = SMB_VFS_STATVFS(conn, smb_fname_cpath, &statbuf);
- if (ret == 0) {
- caps = statbuf.FsCapabilities;
- }
+ uint32_t caps = vfs_get_fs_capabilities(handle->conn, p_ts_res);
- *p_ts_res = TIMESTAMP_SET_SECONDS;
-
- /* Work out what timestamp resolution we can
- * use when setting a timestamp. */
-
- ret = SMB_VFS_STAT(conn, smb_fname_cpath);
- if (ret == -1) {
- TALLOC_FREE(smb_fname_cpath);
- return caps;
- }
-
- if (smb_fname_cpath->st.st_ex_mtime.tv_nsec ||
- smb_fname_cpath->st.st_ex_atime.tv_nsec ||
- smb_fname_cpath->st.st_ex_ctime.tv_nsec) {
- /* If any of the normal UNIX directory timestamps
- * have a non-zero tv_nsec component assume
- * we might be able to set sub-second timestamps.
- * See what filetime set primitives we have.
- */
-#if defined(HAVE_UTIMENSAT)
- *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
-#elif defined(HAVE_UTIMES)
- /* utimes allows msec timestamps to be set. */
- *p_ts_res = TIMESTAMP_SET_MSEC;
-#elif defined(HAVE_UTIME)
- /* utime only allows sec timestamps to be set. */
- *p_ts_res = TIMESTAMP_SET_SECONDS;
+#if defined(HAVE_SYS_QUOTAS)
+ caps |= FILE_VOLUME_QUOTAS;
#endif
- DBG_DEBUG("vfswrap_fs_capabilities: timestamp "
- "resolution of %s "
- "available on share %s, directory %s\n",
- *p_ts_res == TIMESTAMP_SET_MSEC ? "msec" : "sec",
- lp_servicename(talloc_tos(), lp_sub,
conn->params->service),
- conn->connectpath );
- }
- TALLOC_FREE(smb_fname_cpath);
return caps;
}
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 00b4cdd4698..433c133a720 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -594,16 +594,12 @@ static int vfs_gluster_statvfs(struct vfs_handle_struct
*handle,
static uint32_t vfs_gluster_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;
+ uint32_t caps = vfs_get_fs_capabilities(handle->conn, p_ts_res);
#ifdef HAVE_GFAPI_VER_6
caps |= FILE_SUPPORTS_SPARSE_FILES;
#endif
-#ifdef STAT_HAVE_NSEC
- *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
-#endif
-
return caps;
}
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 90387aeb6c3..093c60adcfa 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -1176,6 +1176,8 @@ NTSTATUS vfs_fstreaminfo(struct files_struct *fsp,
void init_smb_file_time(struct smb_file_time *ft);
int vfs_fake_fd(void);
int vfs_fake_fd_close(int fd);
+uint32_t vfs_get_fs_capabilities(struct connection_struct *conn,
+ enum timestamp_set_resolution *ts_res);
/* The following definitions come from smbd/avahi_register.c */
diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c
index b57cb295a7c..2a253d65361 100644
--- a/source3/smbd/smb2_trans2.c
+++ b/source3/smbd/smb2_trans2.c
@@ -2041,7 +2041,6 @@ NTSTATUS smbd_do_qfsinfo(struct smbXsrv_connection *xconn,
const char *fstype = lp_fstype(SNUM(conn));
const char *filename = NULL;
const uint64_t bytes_per_sector = 512;
- uint32_t additional_flags = 0;
struct smb_filename smb_fname;
SMB_STRUCT_STAT st;
NTSTATUS status = NT_STATUS_OK;
@@ -2172,24 +2171,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n",
(unsigned int)st.st_ex_dev, (u
case SMB_QUERY_FS_ATTRIBUTE_INFO:
case SMB_FS_ATTRIBUTE_INFORMATION:
- additional_flags = 0;
-#if defined(HAVE_SYS_QUOTAS)
- additional_flags |= FILE_VOLUME_QUOTAS;
-#endif
-
- if(lp_nt_acl_support(SNUM(conn))) {
- additional_flags |= FILE_PERSISTENT_ACLS;
- }
-
- /* Capabilities are filled in at connection time
through STATVFS call */
- additional_flags |= conn->fs_capabilities;
- additional_flags |= lp_parm_int(conn->params->service,
- "share", "fake_fscaps",
- 0);
-
SIVAL(pdata,0,FILE_CASE_PRESERVED_NAMES|FILE_CASE_SENSITIVE_SEARCH|
FILE_SUPPORTS_OBJECT_IDS|FILE_UNICODE_ON_DISK|
- additional_flags); /* FS ATTRIBUTES */
+ conn->fs_capabilities); /* FS ATTRIBUTES */
SIVAL(pdata,4,255); /* Max filename component length */
/* NOTE! the fstype must *not* be null terminated or
win98 won't recognise it
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 13b3ba61cea..388a5a90fc6 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1300,6 +1300,78 @@ NTSTATUS vfs_at_fspcwd(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
+uint32_t vfs_get_fs_capabilities(struct connection_struct *conn,
+ enum timestamp_set_resolution *ts_res)
+{
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+ struct smb_filename *smb_fname_cpath = NULL;
+ struct vfs_statvfs_struct statbuf;
+ int ret;
+
+ smb_fname_cpath = synthetic_smb_fname(talloc_tos(),
+ conn->connectpath,
+ NULL,
+ NULL,
+ 0,
+ 0);
+ if (smb_fname_cpath == NULL) {
+ return caps;
+ }
+
+ ZERO_STRUCT(statbuf);
+ ret = SMB_VFS_STATVFS(conn, smb_fname_cpath, &statbuf);
+ if (ret == 0) {
+ caps = statbuf.FsCapabilities;
+ }
+
+ if (lp_nt_acl_support(SNUM(conn))) {
+ caps |= FILE_PERSISTENT_ACLS;
+ }
+
+ caps |= lp_parm_int(SNUM(conn), "share", "fake_fscaps", 0);
+
+ *ts_res = TIMESTAMP_SET_SECONDS;
+
+ /* Work out what timestamp resolution we can
+ * use when setting a timestamp. */
+
+ ret = SMB_VFS_STAT(conn, smb_fname_cpath);
+ if (ret == -1) {
+ TALLOC_FREE(smb_fname_cpath);
+ return caps;
+ }
+
+ if (smb_fname_cpath->st.st_ex_mtime.tv_nsec ||
+ smb_fname_cpath->st.st_ex_atime.tv_nsec ||
+ smb_fname_cpath->st.st_ex_ctime.tv_nsec) {
+ /* If any of the normal UNIX directory timestamps
+ * have a non-zero tv_nsec component assume
+ * we might be able to set sub-second timestamps.
+ * See what filetime set primitives we have.
+ */
+#if defined(HAVE_UTIMENSAT)
+ *ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+#elif defined(HAVE_UTIMES)
+ /* utimes allows msec timestamps to be set. */
+ *ts_res = TIMESTAMP_SET_MSEC;
+#elif defined(HAVE_UTIME)
+ /* utime only allows sec timestamps to be set. */
+ *ts_res = TIMESTAMP_SET_SECONDS;
+#endif
+
+ DBG_DEBUG("vfs_get_fs_capabilities: timestamp "
+ "resolution of %s "
+ "available on share %s, directory %s\n",
+ *ts_res == TIMESTAMP_SET_MSEC ? "msec" : "sec",
+ lp_servicename(talloc_tos(), lp_sub,
conn->params->service),
+ conn->connectpath );
+ }
+ TALLOC_FREE(smb_fname_cpath);
+ return caps;
+}
+
static struct smb_vfs_deny_state *smb_vfs_deny_global;
void smb_vfs_assert_allowed(void)
--
Samba Shared Repository