Bug 12427 - vfs_fruit doesn't work with fruit:metadata=stream
vfs_fruit doesn't work with fruit:metadata=stream
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules
unspecified
All All
: P5 major
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks: 12526
  Show dependency treegraph
 
Reported: 2016-11-15 19:31 UTC by Ralph Böhme
Modified: 2017-03-13 08:13 UTC (History)
3 users (show)

See Also:


Attachments
Proposed fixes for vfs_fruit stream mode (4.18 KB, application/mbox)
2016-12-05 23:37 UTC, Aaron Laffin
no flags Details
Patch for 4.5 cherry-picked from master (240.55 KB, patch)
2017-03-03 11:08 UTC, Ralph Böhme
slow: review? (metze)
uri: review+
Details
Patch for 4.6 cherry-picked from master (240.55 KB, patch)
2017-03-03 11:09 UTC, Ralph Böhme
slow: review? (metze)
uri: review+
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:
<https://git.samba.org/?p=slow/samba.git;a=shortlog;h=refs/heads/fruit-metadata>

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.
Comment 6 Ralph Böhme 2017-03-03 11:08:18 UTC
Created attachment 13009 [details]
Patch for 4.5 cherry-picked from master

All committs cherry-picked besides "vfs_fruit: rework struct adouble API" which didn't apply and needed minimal changes.
Comment 7 Ralph Böhme 2017-03-03 11:09:03 UTC
Created attachment 13010 [details]
Patch for 4.6 cherry-picked from master
Comment 8 Ralph Böhme 2017-03-03 11:19:22 UTC
No patch for 4.4 here, it's not possible to backport due to the changes at the VFS layer and the size of the patchset.
Comment 9 Ralph Böhme 2017-03-04 21:26:04 UTC
Reassigning to Karolin for inclusion in 4.5 and 4.6.
Comment 10 Karolin Seeger 2017-03-06 07:28:39 UTC
(In reply to Ralph Böhme from comment #9)
Pushed to autobuild-v4-{6,5}-test.
Comment 11 Karolin Seeger 2017-03-13 08:13:03 UTC
(In reply to Karolin Seeger from comment #10)
Pushed to both branches.
Closing out bug report.

Thanks!