Created attachment 6824 [details] Patch Currently the VFS op "streaminfo" is not stackable, ie it's only possible to have one active VFS module to take care of streams, eg "streams_xattr". Now what I'm trying to do is enhance the Netatalk VFS module, so that it presents the Netatalk AppleDouble stuff as streams. But as I only want to implement dealing with the relevant streams in the Netatalk VFS mod, leaving all the rest to the "default" stream module (streams_xattr), I need to a) place the Netatalk VFS mod before streams_xattr b) patch the VFS base code and modules to make the streaminfo op stackable Patch attached.
Created attachment 6825 [details] Fixed patch Previous patch contained changes for the modules itself.
Please leave the macro SMB_VFS_STREAMINFO untouched. As the smb_vfs_call routines, the macros are supposed to be completely boiler-plate. Please create a wrapper function and change all the callers. If you insist on changing the macros, please get other developers to overrule me here via samba-technical@samba.org. With best regards, Volker Lendecke
Created attachment 6838 [details] Patch implementing function wrapper vfs_streaminfo
(In reply to comment #3) > Created attachment 6838 [details] > Patch implementing function wrapper vfs_streaminfo Can you replace + VFS_FIND(streaminfo); + return handle->fns->streaminfo(handle, fsp, fname, mem_ctx, + num_streams, streams); by + return SMB_VFS_STREAMINFO(...) ? Volker
Created attachment 6843 [details] Patch implementing function wrapper vfs_streaminfo Replace + VFS_FIND(streaminfo); + return handle->fns->streaminfo(handle, fsp, fname, mem_ctx, + num_streams, streams); by + return SMB_VFS_STREAMINFO(...)
Created attachment 6924 [details] Patch adding support for VFS op streaminfo chaining in all relevant VFS modules Patch adding support for VFS op streaminfo chaining in all relevant VFS modules.
The problem with the patch is that it doesn't initialize the variables when SMB_VFS_STREAMINFO() is called - see delete_all_streams() for example. It needs to also initialize *stream_info and num_streams to NULL, 0, before calling SMB_VFS_STREAMINFO() otherwise the stacked modules are reallocating uninitialized memory. I'll fix this up and post for your review. Jeremy.
I've pushed a fixed patch to master. Once it passes autobuild I'll update here for your review. Jeremy.
Created attachment 7002 [details] git-am fix I pushed to master Frank, here is what I've pushed to master. Can you test this in 3.6.x and report back if it works for you. If so I'll get a second Team review and we'll get it added to 3.6.x. Cheers, Jeremy.
(In reply to comment #7) > The problem with the patch is that it doesn't initialize the variables when > SMB_VFS_STREAMINFO() is called - see delete_all_streams() for example. Did you possibly missed [patch 1/2] ? <https://attachments.samba.org/attachment.cgi?id=6843> That's the one implementing the new function wrapper vfs_streaminfo() which does the necessary initialisation and replaces SMB_VFS_STREAMINFO(). Afaict you only reviewed, fixed and commited [patch 2/2]: <https://attachments.samba.org/attachment.cgi?id=6924> Thanks! -f
Ah yes - that's the problem when you split a git-am patch into two attachments. I missed the first one (sorry). The way to do this is to type: git format-patch --stdout REFSPEC1..REFSPEC2 >/tmp/patch-name - that puts both fixes into one file. I'll add in your patch #1 as well. Cheers, Jeremy.
Created attachment 7006 [details] git-am fix for 3.6.1 Second part of fix. Frank, please review with both and I'll get a Team review to add for 3.6.2. Thanks, Jeremy.
Comment on attachment 7002 [details] git-am fix I pushed to master This one should be marked obsolete.
(In reply to comment #12) > Created attachment 7006 [details] > git-am fix for 3.6.1 > > Second part of fix. Frank, please review with both and I'll get a Team review > to add for 3.6.2. Thanks a lot. I've tested your patch 7006 together with my patch 6924. Looks good. 7002 should be marked obsolete. As you've applied 7002 to master, you've got to either revert that or adjust 6924/7006 accordingly, but I guess you're aware of that. Sorry for the mess I introduced by submitting the patches seperately. Thanks for you help!
Comment on attachment 7002 [details] git-am fix I pushed to master No, this one isn't obsolete as it does more than just set the variables to NULL. It's safer to have both fixes in, so I'm going to leave it like that.
Created attachment 7011 [details] git-am fix for 3.6.2 containing both changes. Final fix for 3.6.2. Volker please review. Thanks ! Jeremy.
Re-assigning to Karolin for inclusion in 3.6.2. Jeremy.
Pushed to v3-6-test. Closing out bug report. Thanks!