Bug 12427 - vfs_fruit doesn't work with fruit:metadata=stream
vfs_fruit doesn't work with fruit:metadata=stream
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules
All All
: P5 major
: ---
Assigned To: Ralph Böhme
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2016-11-15 19:31 UTC by Ralph Böhme
Modified: 2016-12-06 22:55 UTC (History)
1 user (show)

See Also:

Proposed fixes for vfs_fruit stream mode (4.18 KB, application/mbox)
2016-12-05 23:37 UTC, Aaron Laffin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2016-11-15 19:31:27 UTC
Unfortunately vfs_fruit is currently not usable with "fruit:metadata=stream".
Comment 1 Ralph Böhme 2016-11-24 14:16:59 UTC
Related: fruit:resource = stream is not tested well either and is probably broken as well.
Comment 2 Aaron Laffin 2016-12-05 23:37:17 UTC
Created attachment 12725 [details]
Proposed fixes for vfs_fruit stream mode

Attached is a patch that contains fixes for issues I have identified in vfs_fruit operating in stream mode.
Comment 3 Aaron Laffin 2016-12-05 23:46:41 UTC
Just posted a patch to fix a few issues I found trying to resolve this particular bug.

A significant piece still missing is correct function of readdir_attr_macmeta(). Allowing FinderInfo to pass through to streams_xattr leaves readdir_attr_macmeta() without access to the FinderInfo stream. Without a fsp, it is difficult to read that stream. Need guidance on the best way to read that stream in readdir_attr_macmeta(). 

I do have a workaround where readdir_attr_macmeta() takes the liberty of calling SMB_VFS_GETXATTR() to directly access the xattr stored by streams_xattr. Works, but fruit reaching around streams_xattr is a bit undesirable.
Comment 4 Ralph Böhme 2016-12-06 05:54:13 UTC
Thanks for looking into this! I'm currently working on a for this as well. My WIP branch is here:

It passes 'make test TESTS=vfs.fruit' and manual testing. While I'm at it I'll be doing more refactoring, so this won't be the final patchset.
Comment 5 Aaron Laffin 2016-12-06 22:55:05 UTC
Nice work. I've reviewed it and its definitely a superset of my work and solves the readdir_attr_macmeta() problem. Will let you know if I find any issues with it.