| Age | Commit message (Collapse) | Author | Files | Lines |
|
vfs_ceph_release_fh() was called explicitly then again via the FSP
extension destructor triggered by vfs_ceph_remove_fh(). Drop the
explicit call and let the destructor handle cleanup.
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Apr 21 22:18:42 UTC 2026 on atb-devel-224
|
|
-ENOMEM cast to uint64_t is not the error sentinel UINT64_MAX and
leaves errno unset. Set errno and return UINT64_MAX instead.
Also replace UINT64_MAX instead of (uint64_t)-1) in all error path.
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
END_PROFILE omits the per-service counter; replace with END_PROFILE_X
to match the START_PROFILE_X on the strict_allocate path.
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
This avoids mixing malloc and talloc allocation patterns and
aligns the code with Samba's memory management conventions.
Signed-off-by: Shwetha Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sat Apr 18 20:58:22 UTC 2026 on atb-devel-224
|
|
snapper_gmt_fstatat is failing when called on items in a
'previous version' snapshot because the wrong timestamp value is
passed (the raw timewarp value is used) and snapper_gmt_convert cannot
find the valid snapshot instance to use.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16058
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Apr 15 15:29:38 UTC 2026 on atb-devel-224
|
|
when trying to browse on windows a snapper share (exposed via windows previous versions) files in subdirs are not visible. In other words only files that are in the root dir of the versioned share can be seen
/ashare/file1
/ashare/file2
/ashare/subdir
/ashare/subdir/subfile1
For example with the file hierarchy above only file1, file2 and subdir are visible. Navigating into subdir shows an empty dir
snapper_gmt_openat is failing because when calling snapper_gmt_convert
it doesn't take into account the path to the subdirectory.
snapper_gmt_convert is just passed the leaf name where it constructs the
snapper path based on the base dir of the share.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16058
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
When Samba closes a directory backed by vfs_glusterfs, the glfs_fd_t
opened by vfs_gluster_openat() is never closed. This leaks one
libgfapi file descriptor and one server-side fd_t in glusterfsd per
directory open/close cycle. With persistent SMB2 connections the
leak is unbounded and drives monotonic RSS growth on the GlusterFS
brick process.
The leak happens because vfs_glusterfs creates two independent
glfs_fd_t handles per directory: one via glfs_open() in
vfs_gluster_openat(), stored in the FSP extension, and another via
glfs_opendir() in vfs_gluster_fdopendir(), tracked by struct smb_Dir.
On close, smb_Dir_destructor() closes the opendir handle and sets the
pathref fd to -1. fd_close() then returns early without calling
SMB_VFS_CLOSE, so vfs_gluster_close() never runs and the glfs_open()
handle is orphaned. The original code passed NULL as the destroy
callback to VFS_ADD_FSP_EXTENSION, so there was no safety net.
The default VFS does not have this problem because fdopendir(3) wraps
the existing kernel fd rather than opening a new handle. libgfapi
has no equivalent -- glfs_opendir() always creates an independent
handle by path. The actual glfs_fd_t is stored in the FSP extension,
not in fsp->fh->fd (which holds a sentinel value), so Samba's generic
close path cannot reach it.
Register vfs_gluster_fsp_ext_destroy() as the FSP extension destroy
callback. It calls glfs_close() on the stored pointer and is invoked
by vfs_remove_all_fsp_extensions() during file_free(), which runs
unconditionally for every fsp. In the explicit close path,
vfs_gluster_close() NULLs the extension pointer before calling
VFS_REMOVE_FSP_EXTENSION to prevent double-close. This follows the
same pattern used by vfs_ceph_new.c (vfs_ceph_fsp_ext_destroy_cb).
Observed on a production file server with persistent SMB2 connections
and continuous directory operations. GlusterFS brick statedumps
showed fd_t pool growth from 1,993 to 80,350 active instances over
6 days, roughly 13,000 leaked fds per day per brick.
RN: Fix a directory file descriptor leak in vfs_glusterfs that caused
unbounded memory growth on the GlusterFS brick with persistent SMB2
connections.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16043
Signed-off-by: Thales Antunes de Oliveira Barretto <thales.barretto.git@gmail.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Apr 8 16:46:12 UTC 2026 on atb-devel-224
|
|
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Apr 2 05:49:13 UTC 2026 on atb-devel-224
|
|
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
Ceph uses negative error valuers but Samba's VFS expects error value as
non-negative values (errno style).
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Mar 26 09:23:11 UTC 2026 on atb-devel-224
|
|
Even in cases where vfs_ceph_ll_link fails, we need to do iput in order
to decrement inode's ref-count.
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
When ceph_getcwd returns NULL (due to out-of-memory) bail out to avoid
segfault in strlen.
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Mar 20 06:35:12 UTC 2026 on atb-devel-224
|
|
Use '#ifdef' instead of '#if' to make the presence of the define
explicit, rather than relying on undefined macros evaluating to zero.
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
Signed-off-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
|
|
While tools like address sanitizer and most likely valgrind
report this it's not actually a real problem.
Most likely the content of default_ext_prefix is still the same
as TALLOC_FREE doesn't explicitly change then content of
the string.
talloc_strdup(config, ext_prefix) may reuse the same memory and the
memcpy in __talloc_strlendup() may get a problem.
Also all values are only controlled by the administrator via
the smb.conf not by the client.
To prove this theory I used the following change:
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index 5d267a1c1fbf..dc20ec1eb2e3 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -1466,18 +1466,25 @@ static int streams_xattr_connect(vfs_handle_struct *handle,
return -1;
}
+ DBG_ERR("default_ext_prefix[%p][%zu][%s]\n",
+ default_ext_prefix, talloc_get_size(default_ext_prefix),
+ default_ext_prefix);
+
ext_prefix = lp_parm_const_string(SNUM(handle->conn),
"streams_xattr",
"ext_prefix",
default_ext_prefix);
+ DBG_ERR("ext_prefix[%p][%s]\n", ext_prefix, ext_prefix);
+ SMB_ASSERT(default_ext_prefix == ext_prefix);
TALLOC_FREE(default_ext_prefix);
+ DBG_ERR("ext_prefix[%p][%s]\n", ext_prefix, ext_prefix);
config->ext_prefix = talloc_strdup(config, ext_prefix);
+ DBG_ERR("config->ext_prefix[%p][%zu][%s]\n",
+ config->ext_prefix, talloc_get_size(config->ext_prefix),
+ config->ext_prefix);
+ SMB_ASSERT(config->ext_prefix == ext_prefix);
if (config->ext_prefix == NULL) {
DEBUG(1, ("talloc_strdup() failed\n"));
errno = ENOMEM;
return -1;
}
- DBG_DEBUG("using stream ext prefix: %s\n", config->ext_prefix);
+ DBG_ERR("using stream ext prefix: %s\n", config->ext_prefix);
config->store_stream_type = lp_parm_bool(SNUM(handle->conn),
"streams_xattr",
Running it twice in a debugger didn't hit any SMB_ASSERT
and printed the expected values:
smbd version 4.25.0pre1-DEVELOPERBUILD started.
Copyright Andrew Tridgell and the Samba Team 1992-2026
daemon 'smbd' : Starting process ...
streams_xattr_connect: default_ext_prefix[0x5555555ed930][19][user.DosStreamExt.]
streams_xattr_connect: ext_prefix[0x5555555ed930][user.DosStreamExt.]
streams_xattr_connect: ext_prefix[0x5555555ed930][user.DosStreamExt.]
streams_xattr_connect: config->ext_prefix[0x5555555ed930][19][user.DosStreamExt.]
streams_xattr_connect: using stream ext prefix: user.DosStreamExt.
smbd version 4.25.0pre1-DEVELOPERBUILD started.
Copyright Andrew Tridgell and the Samba Team 1992-2026
daemon 'smbd' : Starting process ...
streams_xattr_connect: default_ext_prefix[0x5555555ed6d0][19][user.DosStreamExt.]
streams_xattr_connect: ext_prefix[0x5555555ed6d0][user.DosStreamExt.]
streams_xattr_connect: ext_prefix[0x5555555ed6d0][user.DosStreamExt.]
streams_xattr_connect: config->ext_prefix[0x5555555ed6d0][19][user.DosStreamExt.]
streams_xattr_connect: using stream ext prefix: user.DosStreamExt.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16035
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Mar 19 15:00:19 UTC 2026 on atb-devel-224
|
|
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Mar 13 10:42:07 UTC 2026 on atb-devel-224
|
|
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Mar 1 21:22:24 UTC 2026 on atb-devel-224
|
|
With only changing into the share root, and the share root never being
a @GMT-path or one with a twrp, we don't need special handling.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Clarify where we just change to the root of the export.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Allow read_bw_limit and write_bw_limit to be specified using
size suffixes (K/M/G/T).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16000
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Introduce local TDB storage for saving and restoring ratelimiter state
(iops_tokens, bytes_tokens, last timestamp). Each share now persists
its read/write limiter state under aio_ratelimit.tdb.
Added VERSION pseudo-key for schema versioning
On disconnect, save the latest state and close TDB.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16000
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Refactor the rate limiter to use a continuous token-bucket model with
configurable burst multiplier. This replaces the older time-window and
delay_max logic.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16000
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Feb 18 11:12:23 UTC 2026 on atb-devel-224
|
|
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
|
|
ceph_openat() does not follow the convention of ignoring 'dirfd' when
the pathname is absolute, resulting in EBADF. As a temporary workaround,
handle this special case in cephwrap_openat() by calling ceph_open()
directly instead of ceph_openat().
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-by: Xavi Hernandez <xhernandez@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Feb 16 17:27:03 UTC 2026 on atb-devel-224
|
|
Avoid calls to SMB_VFS_CHDIR and SMB_VFS_GETWD by using
openat_pathref_fsp()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Sun Feb 15 11:45:52 UTC 2026 on atb-devel-224
|
|
Use /proc/self/mountinfo to find the block device a file is mounted on for
quotactl purposes.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
To replace SMB_VFS_STATVFS next
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
The modules that change the pathname need a synthetic_pathref now for
the SMB_VFS_NEXT_DISK_FREE() call. I think this is the right thing to
do anyway, as this goes through all the path scrutiny and does not
depend on direct multi-component paths anymore.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Makes it a bit easier to read for me.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
In the error returns we leaked "streams" on "req". Fix this and
simplify the error paths by using "streams" as temporary talloc
context.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|
|
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
|