roemer wrote:Testing FILENAME/..namedfork/rsrc, it seems to work if one writes and reads via that special path, but if you write the extended attribute directly using xattr, you cannot read it via the special path:
OK this one is actually quite fun.
The first call of; "echo HelloWorld > test/..namedfork/rsrc" will call "vnop_makenamedstream()", so it creates an xattr_dir entry under "com.apple.ResourceFork" and give the vnode to XNU.
You can now "cat" it fine.
The using "xattr -w com.apple.ResourceFork" we are called via "vnop_setxattr()", where we go an write a regular "com.apple.ResourceFork",
which is preferentially be an xattr=SA. Ie, cached in nvlist array.
The following "cat" calls zfs_dirlook("com.apple.ResourceFork") inside the xattr directory, which of course, does not exist. (as it is cached as a nvlist).
Good luck pointing a vnode to a cached nvlist too.
Questions:
1) Why is it always using xattr=sa? I didn't set it, but maybe its the default now
2) We need to make "com.apple.ResourceFork" be forced to always be an xattr=dir type. Some minor reduction of speed from it.