[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Fri Jan 26 16:57:01 UTC 2024


The branch, master has been updated
       via  fe8d866d2c6 vfs_ceph: Implement SMB_VFS_FSTATAT
       via  fe16ae1fe83 source3/wscript: Announce deprecation of old Ceph version support
       via  858b1d064db vfs_ceph: Indicate a successful connection in logs
       via  e657fca589c vfs_ceph: Fix a usage in comments
      from  d63e972aa09 WHATSNEW: Add entry for new save/restore options for smbcacls

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fe8d866d2c619a16cd114e06802efddea4d08e13
Author: Anoop C S <anoopcs at samba.org>
Date:   Tue Jan 9 11:11:40 2024 +0530

    vfs_ceph: Implement SMB_VFS_FSTATAT
    
    Signed-off-by: Anoop C S <anoopcs at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Fri Jan 26 16:56:59 UTC 2024 on atb-devel-224

commit fe16ae1fe8345259a380eb1d02a20eb043e08d47
Author: Anoop C S <anoopcs at samba.org>
Date:   Thu Jan 25 22:56:26 2024 +0530

    source3/wscript: Announce deprecation of old Ceph version support
    
    *at() variants for various libcephfs APIs were added with Ceph v17.x.
    Any other version less than v17.x is soon to be considered EOL[1] which
    we will now indicate with the help of a warning message during configure
    time. Going further such a situation will result in disabling the module
    altogether with the next major Samba version after v4.20.
    
    [1] https://docs.ceph.com/en/latest/releases/#ceph-releases-index
    
    Signed-off-by: Anoop C S <anoopcs at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit 858b1d064db82606c44d5ef5a6098b1b924d5c49
Author: Anoop C S <anoopcs at samba.org>
Date:   Fri Jan 5 12:45:14 2024 +0530

    vfs_ceph: Indicate a successful connection in logs
    
    Signed-off-by: Anoop C S <anoopcs at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

commit e657fca589ce273d92268889fd9fe8fd98b3a201
Author: Anoop C S <anoopcs at samba.org>
Date:   Mon Dec 18 21:27:44 2023 +0530

    vfs_ceph: Fix a usage in comments
    
    Signed-off-by: Anoop C S <anoopcs at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>

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

Summary of changes:
 source3/modules/vfs_ceph.c | 49 +++++++++++++++++++++++++++++++++++++++++++++-
 source3/wscript            | 23 ++++++++++++----------
 2 files changed, 61 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 7f0bad8ae33..4387918198e 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -55,7 +55,7 @@
 
 /*
  * Note, libcephfs's return code model is to return -errno! So we have to
- * convert to what Samba expects, with is set errno to -return and return -1
+ * convert to what Samba expects, which is to set errno to -return and return -1
  */
 #define WRAP_RETURN(_res) \
 	errno = 0; \
@@ -285,6 +285,7 @@ static int cephwrap_connect(struct vfs_handle_struct *handle,
 
       connect_ok:
 	handle->data = cmount;
+	DBG_WARNING("Connection established with the server: %s\n", cookie);
 	/*
 	 * Unless we have an async implementation of getxattrat turn this off.
 	 */
@@ -944,6 +945,51 @@ static int cephwrap_fstat(struct vfs_handle_struct *handle, files_struct *fsp, S
 	return result;
 }
 
+static int cephwrap_fstatat(struct vfs_handle_struct *handle,
+			    const struct files_struct *dirfsp,
+			    const struct smb_filename *smb_fname,
+			    SMB_STRUCT_STAT *sbuf,
+			    int flags)
+{
+	int result = -1;
+	struct ceph_statx stx = { 0 };
+#ifdef HAVE_CEPH_STATXAT
+	int dirfd = fsp_get_pathref_fd(dirfsp);
+
+	DBG_DEBUG("[CEPH] fstatat(%p, %d, %s)\n",
+		  handle, dirfd, smb_fname->base_name);
+	result = ceph_statxat(handle->data, dirfd, smb_fname->base_name,
+			      &stx, SAMBA_STATX_ATTR_MASK, 0);
+#else
+	struct smb_filename *full_fname = NULL;
+
+	full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+						  dirfsp,
+						  smb_fname);
+	if (full_fname == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
+
+	DBG_DEBUG("[CEPH] fstatat(%p, %s)\n",
+		  handle, smb_fname_str_dbg(full_fname));
+	result = ceph_statx(handle->data, full_fname->base_name,
+			    &stx, SAMBA_STATX_ATTR_MASK, 0);
+
+	TALLOC_FREE(full_fname);
+#endif
+
+	DBG_DEBUG("[CEPH] fstatat(...) = %d\n", result);
+	if (result < 0) {
+		WRAP_RETURN(result);
+	}
+
+	init_stat_ex_from_ceph_statx(sbuf, &stx);
+	DBG_DEBUG("[CEPH] mode = 0x%x\n", sbuf->st_ex_mode);
+
+	return 0;
+}
+
 static int cephwrap_lstat(struct vfs_handle_struct *handle,
 			 struct smb_filename *smb_fname)
 {
@@ -1858,6 +1904,7 @@ static struct vfs_fn_pointers ceph_fns = {
 	.stat_fn = cephwrap_stat,
 	.fstat_fn = cephwrap_fstat,
 	.lstat_fn = cephwrap_lstat,
+	.fstatat_fn = cephwrap_fstatat,
 	.unlinkat_fn = cephwrap_unlinkat,
 	.fchmod_fn = cephwrap_fchmod,
 	.fchown_fn = cephwrap_fchown,
diff --git a/source3/wscript b/source3/wscript
index 12394ef84b1..b76ced59aa4 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1679,16 +1679,19 @@ int main(void) {
             conf.DEFINE('HAVE_CEPH', '1')
             conf.CHECK_FUNCS_IN('ceph_select_filesystem', 'cephfs',
                                 headers='cephfs/libcephfs.h')
-            conf.CHECK_FUNCS_IN('ceph_mkdirat', 'cephfs',
-                                headers='cephfs/libcephfs.h')
-            conf.CHECK_FUNCS_IN('ceph_openat', 'cephfs',
-                                headers='cephfs/libcephfs.h')
-            conf.CHECK_FUNCS_IN('ceph_unlinkat', 'cephfs',
-                                headers='cephfs/libcephfs.h')
-            conf.CHECK_FUNCS_IN('ceph_symlinkat', 'cephfs',
-                                headers='cephfs/libcephfs.h')
-            conf.CHECK_FUNCS_IN('ceph_readlinkat', 'cephfs',
-                                headers='cephfs/libcephfs.h')
+            conf.DEFINE('HAVE_MANDATORY_CEPH_API', '1')
+            for api in ['ceph_mkdirat', 'ceph_openat', 'ceph_unlinkat',
+                        'ceph_symlinkat', 'ceph_readlinkat', 'ceph_statxat']:
+                if not conf.CHECK_FUNCS_IN(api, 'cephfs',
+                                           headers='cephfs/libcephfs.h'):
+                    conf.undefine('HAVE_MANDATORY_CEPH_API')
+            if not conf.env.HAVE_MANDATORY_CEPH_API:
+                Logs.warn("Installed Ceph version support is at the verge of "
+                          "deprecation due to the absence of some mandatory "
+                          "libcephfs APIs. This warning there shall result in "
+                          "disabling the Ceph VFS module altogether with the "
+                          "next major Samba version. It is highly recommended "
+                          "to update to a more recent/active version of Ceph.")
         else:
             Logs.warn('''Ceph support disabled due to --without-acl-support
                       or lack of ceph_statx support''')


-- 
Samba Shared Repository



More information about the samba-cvs mailing list