The branch, v4-22-test has been updated
       via  36e71a04144 WHATSNEW: mention schema upgrade speed improvements
       via  0d4a204cdb1 vfs_shadow_copy2: Use VFS interface to derive mount 
point
      from  ca2add8c968 s3:smbd: disable "vfs mkdir use tmp name = auto" on 
OpenBSD

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


- Log -----------------------------------------------------------------
commit 36e71a04144e0cd35bb96d72aa235b5609c28356
Author: Douglas Bagnall <[email protected]>
Date:   Wed Mar 5 18:01:42 2025 +1300

    WHATSNEW: mention schema upgrade speed improvements
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15821
    
    Signed-off-by: Douglas Bagnall <[email protected]>
    
    Autobuild-User(v4-22-test): Jule Anger <[email protected]>
    Autobuild-Date(v4-22-test): Thu Mar  6 12:47:56 UTC 2025 on atb-devel-224

commit 0d4a204cdb1e90604085609c52a0f86fc34c6fa1
Author: Anoop C S <[email protected]>
Date:   Thu Feb 6 17:50:10 2025 +0530

    vfs_shadow_copy2: Use VFS interface to derive mount point
    
    shadow_copy2_find_mount_point() does direct stat() calls locally while
    trying to automatically detect the mount point. This cannot be always
    true as there are virtual file systems like CephFS, GlusterFS etc.
    without their share path locally available on the system. Instead use
    the VFS interface to make the stat calls hit the underlying file system
    irrespective of their local presence in the system.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15797
    
    Signed-off-by: Anoop C S <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>
    Reviewed-by: John Mulligan <[email protected]>
    
    Autobuild-User(master): Anoop C S <[email protected]>
    Autobuild-Date(master): Fri Feb  7 06:23:12 UTC 2025 on atb-devel-224
    
    (cherry picked from commit c7d0adade09fa264201a125b28dd76c163451260)

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

Summary of changes:
 WHATSNEW.txt                       |  8 ++++++++
 source3/modules/vfs_shadow_copy2.c | 31 +++++++++++++++++++++----------
 2 files changed, 29 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index ccb811920bb..3f9a50100d0 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -50,6 +50,14 @@ parameters include `himmelblaud_sfa_fallback`, 
`himmelblaud_hello_enabled`, and
 `himmelblaud_hsm_pin_path`.
 To enable, configure Samba with `--enable-rust --with-himmelblau`.
 
+AD DC schema upgrade and provision performance improvements
+-----------------------------------------------------------
+
+By increasing the LDB index cache size for certain offline operations
+that are likely to require large transactions, these are now several
+times faster.
+
+
 REMOVED FEATURES
 ================
 
diff --git a/source3/modules/vfs_shadow_copy2.c 
b/source3/modules/vfs_shadow_copy2.c
index 8db3e664f19..42626653e0f 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -726,31 +726,42 @@ static bool 
_shadow_copy2_strip_snapshot_converted(TALLOC_CTX *mem_ctx,
 static char *shadow_copy2_find_mount_point(TALLOC_CTX *mem_ctx,
                                           vfs_handle_struct *handle)
 {
-       char *path = talloc_strdup(mem_ctx, handle->conn->connectpath);
+       struct smb_filename *smb_fname_cpath = NULL;
        dev_t dev;
-       struct stat st;
        char *p;
 
-       if (stat(path, &st) != 0) {
-               talloc_free(path);
+       smb_fname_cpath = synthetic_smb_fname(mem_ctx,
+                                             handle->conn->connectpath,
+                                             NULL,
+                                             NULL,
+                                             0,
+                                             0);
+       if (smb_fname_cpath == NULL) {
+               errno = ENOMEM;
+               return NULL;
+       }
+
+       if (SMB_VFS_NEXT_STAT(handle, smb_fname_cpath) != 0) {
+               TALLOC_FREE(smb_fname_cpath);
                return NULL;
        }
 
-       dev = st.st_dev;
+       dev = smb_fname_cpath->st.st_ex_dev;
 
-       while ((p = strrchr(path, '/')) && p > path) {
+       while ((p = strrchr(smb_fname_cpath->base_name, '/')) &&
+                       p > smb_fname_cpath->base_name) {
                *p = 0;
-               if (stat(path, &st) != 0) {
-                       talloc_free(path);
+               if (SMB_VFS_NEXT_STAT(handle, smb_fname_cpath) != 0) {
+                       TALLOC_FREE(smb_fname_cpath);
                        return NULL;
                }
-               if (st.st_dev != dev) {
+               if (smb_fname_cpath->st.st_ex_dev != dev) {
                        *p = '/';
                        break;
                }
        }
 
-       return path;
+       return smb_fname_cpath->base_name;
 }
 
 /**


-- 
Samba Shared Repository

Reply via email to