VFS connection data cleanup with multiple modules
Constantine Vetoshev
gepardcv at gmail.com
Tue Sep 30 20:39:44 GMT 2008
I'm trying to use a stack of VFS modules, and I see strange behavior
with reclaiming connection-specific data at disconnect time.
Specifically, it seems that the function which releases
connection-specific data only runs for the first VFS module loaded.
Simplified example follows. Here's a snippet of the smb.conf which
loads the modules:
[share]
path = /my/path
vfs objects = vfs_object_1 vfs_object_2
I'm using release_data_X function pointers when I set the connection
data in connect callbacks as follows:
In vfs_object_1:
SMB_VFS_HANDLE_SET_DATA(
handle, data, release_data_1, conn_data_1, return -1);
In vfs_object_2:
SMB_VFS_HANDLE_SET_DATA(
handle, data, release_data_2, conn_data_2, return -1);
and so on, where release_data_1 is a pointer to a function which
releases the memory and resources in the conn_data_1 struct, and
release_data_2 releases memory and resources in the conn_data_2
struct.
When I disconnect from the share, I expect that release_data_1 and
release_data_2 both run, but logging shows that only release_data_1
runs. I can force release_data_2 to run by putting an explicit call to
it from a disconnect callback for vfs_object_2, but that doesn't seem
right.
Am I missing something about how the release functions should work?
I'm currently using Samba 3.0.28a.
More information about the samba-technical
mailing list