lundman wrote:OK so is there a difference to hfs/apfs in the current behavior? Cos we could make sure to remove empty xattrs. What creates them?
Actually, I think we are doing well:
Regarding normal xattr, zfs matches HFS/ZFS.
Regarding com.apple.FinderInfo, zfs with mimic=apfs|off matches APFS, and with mimic=hfs matches HFS.
Regarding com.apple.ResourceFork, zfs seems to match apfs and zfs, with the exception that apfs/hfs do not list empty resource forks as xattr.
Example with APFS below; note how it gives no error message when writing a ResourceFork, but then I cannot list it as extended attribute, though accessing it using ..namedfork/rsrc seems to work:
- Code: Select all
touch testfile-apfs
xattr -w com.apple.ResourceFork "" testfile-apfs
ls -l@ testfile-apfs
-rw-r--r-- 1 user staff 0 26 Feb 19:05 testfile-apfs
xattr -lx testfile-apfs
[no output, but also no error]
cat testfile-apfs/..namedfork/rsrc
[no output, but also no error]
wc testfile-apfs/..namedfork/rsrc
0 0 0 testfile-apfs/..namedfork/rsrc
With ZFS 2.1.6-99, a 0-length com.apple.ResourceFork xattr is explicitly listed, otherwise everything is the same as with APFS:
- Code: Select all
touch testfile-zfs
xattr -w com.apple.ResourceFork '' testfile-zfs
ls -l@ testfile-zfs
-rw-r--r--@ 1 user staff 0 26 Feb 19:06 testfile-zfs
com.apple.ResourceFork 0
xattr -lx testfile-zfs
com.apple.ResourceFork:
00000000
cat testfile-zfs/..namedfork/rsrc
[no output, but also no error]
wc testfile-zfs/..namedfork/rsrc
0 0 0 testfile-zfs/..namedfork/rsrc
I originally tried only the xattr access and saw a difference in output; but looking at the full picture above including using ..namedfork/rsrc , I think this should be fine. I actually like that ZFS shows with xattr that there is an empty resource fork, while APFS seems to hide it...