Hi Bjorn,

The 4.25.x series show errors for me when my win 10 home machine tries
to write a file. The request to find free disk space fails.

Oct 24 12:19:47 xena smbd[88768]: [2026/10/24 12:19:47.020351,  0] 
../../source3/smbd/dfree.c:154(sys_disk_free)
Oct 24 12:19:47 xena smbd[88768]:   sys_disk_free: VFS disk_free failed. Error 
was : Invalid argument

This doesn’t happen for my macOS hosts or Ubuntu hosts.

I haven’t had the time to track down the source of the issue yet, but trying to 
follow the Samba’s people rewrite of the
VFS layer in to 2021 shows it to be a nested maze of macros…. I’ll try and pick 
up the debugging again next week.


../../source3/smbd/dfree.c:154(sys_disk_free)

    if (SMB_VFS_DISK_FREE(conn, fsp, bsize, dfree, dsize) == (uint64_t)-1)
    {
        DBG_ERR("VFS disk_free failed. Error was : %s\n",
            strerror(errno));
        return (uint64_t)-1;
    }

-----

ianm-openbsd:source3 {10} grep -r SMB_VFS_DISK_FREE *
include/vfs.h: * Version 32 - Remove unnecessary SMB_VFS_DISK_FREE() 
small_query parameter
include/vfs_macros.h:#define SMB_VFS_DISK_FREE(conn, fsp, bsize, dfree, dsize) \
modules/The_New_VFS.org:| SMB_VFS_DISK_FREE()               | [[Disk][Disk]]    
 | -      |
modules/The_New_VFS.org: - SMB_VFS_DISK_FREE()
modules/The_New_VFS.txt:   SMB_VFS_DISK_FREE()                [Disk]      -
modules/The_New_VFS.txt:  • SMB_VFS_DISK_FREE()
smbd/dfree.c:   if (SMB_VFS_DISK_FREE(conn, fsp, bsize, dfree, dsize) == 
(uint64_t)-1)
torture/cmd_vfs.c:      diskfree = SMB_VFS_DISK_FREE(


------

include/vfs_macros.h:#define SMB_VFS_DISK_FREE(conn, fsp, bsize, dfree, dsize) \


#define SMB_VFS_DISK_FREE(conn, fsp, bsize, dfree, dsize) \
    smb_vfs_call_disk_free(                           \
        (conn)->vfs_handles, (fsp), (bsize), (dfree), (dsize)) 


------

smbd/vfs.c:uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct *handle,

uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct *handle,
                struct files_struct *fsp,
                uint64_t *bsize,
                uint64_t *dfree,
                uint64_t *dsize)
{
    VFS_FIND(disk_free);
    return handle->fns->disk_free_fn(handle, fsp, bsize, dfree, dsize);
}

-------

smbd/vfs.c:#define VFS_FIND(__fn__) do { \

#define VFS_FIND(__fn__) do { \
    if (unlikely(smb_vfs_deny_global != NULL)) { \
        DBG_ERR("Called with VFS denied by %s\n", \
            smb_vfs_deny_global->location); \
        smb_panic("Called with VFS denied!"); \
    } \
    while (handle->fns->__fn__##_fn==NULL) { \
        handle = handle->next; \
    } \
} while(0)

-----


include/vfs.h:  uint64_t (*disk_free_fn)(struct vfs_handle_struct *handle,


    uint64_t (*disk_free_fn)(struct vfs_handle_struct *handle,  
                 struct files_struct *fsp,
                 uint64_t *bsize,
                 uint64_t *dfree,
                 uint64_t *dsize);


modules/vfs_fruit.c:    .disk_free_fn = fruit_disk_free,
modules/vfs_default.c:  .disk_free_fn = vfswrap_disk_free,



Ian McWilliam

> On 24 Oct 2026, at 04:00, Bjorn Ketelaars <[email protected]> wrote:
> 
> Diff below updates samba to 4.25.1. Changes:
> https://www.samba.org/samba/history/samba-4.25.1.html.
> 
> Run tested on amd64.
> 
> OK for committing this to -current and -stable?
> 
> 
> diff --git Makefile Makefile
> index 3f44577efcc..c9a5b3c17dc 100644
> --- Makefile
> +++ Makefile
> @@ -1,4 +1,4 @@
> -VERSION =            4.25.0
> +VERSION =            4.25.1
> DISTNAME =            samba-${VERSION}
> EPOCH =                       0
> 
> diff --git distinfo distinfo
> index 6a9d15ef89f..3a2a012dd89 100644
> --- distinfo
> +++ distinfo
> @@ -1,2 +1,2 @@
> -SHA256 (samba-4.25.0.tar.gz) = Liy3KWgzs1uPen+3YEXgxXrcDCzQMmSzffXVjkDyhDc=
> -SIZE (samba-4.25.0.tar.gz) = 43571277
> +SHA256 (samba-4.25.1.tar.gz) = fzZ1Rbymmqlol2KPgvDwTUtms7yzbLl4ubuVLEtMQo0=
> +SIZE (samba-4.25.1.tar.gz) = 43590836
> diff --git patches/patch-lib_util_statvfs_c patches/patch-lib_util_statvfs_c
> deleted file mode 100644
> index 80690c8f900..00000000000
> --- patches/patch-lib_util_statvfs_c
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -Fix a type mismatch by passing OpenBSD's native struct statfs—which contains
> -non-standard fields like f_iosize and f_flags—instead of POSIX struct 
> statvfs.
> -
> -Index: lib/util/statvfs.c
> ---- lib/util/statvfs.c.orig
> -+++ lib/util/statvfs.c
> -@@ -79,7 +79,7 @@ static int darwin_fs_capabilities(const char * path)
> - 
> - #if defined(BSD_STYLE_STATVFS)
> - 
> --static void bsd_init_statvfs(const struct statvfs *src,
> -+static void bsd_init_statvfs(const struct statfs *src,
> -                          struct vfs_statvfs_struct *dst)
> - {
> -     dst->OptimalTransferSize = src->f_iosize;

Reply via email to