openzfsonosx / zfs

OpenZFS on OS X
https://openzfsonosx.org/
Other
823 stars 72 forks source link

xattr not copied accurately #428

Open ilovezfs opened 8 years ago

ilovezfs commented 8 years ago
bash-3.2$ #First HFS+
bash-3.2$ mkdir /tmp/h/
bash-3.2$ cd /tmp/h/
bash-3.2$ sudo cp -fpR /usr/ hfsCopiesAccurately/
Password:
^Cbash-3.2$ xattr -l /usr/
com.apple.FinderInfo:
00000000  00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  |........@.......|
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
00000020
bash-3.2$ xattr -l hfsCopiesAccurately/
com.apple.FinderInfo:
00000000  00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  |........@.......|
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
00000020
bash-3.2$ #Now ZFS
bash-3.2$ mkdir /Volumes/internal/xattrtest/z/
bash-3.2$ cd /Volumes/internal/xattrtest/z/
bash-3.2$ sudo cp -fpR /usr/ zfsCopiesInaccurately/
^Cbash-3.2$ xattr -l /usr/
com.apple.FinderInfo:
00000000  00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  |........@.......|
00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
00000020
bash-3.2$ xattr -l zfsCopiesInaccurately/
com.apple.FinderInfo:
00000000  00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  |........@.......|
00000010  00 00 00 00 56 40 7E 21 00 00 00 00 00 00 00 00  |....V@~!........|
00000020
bash-3.2$ ~/bin/FSMegaInfo getattrlist -ATTR_CMN_ADDEDTIME /usr/
getattrlist -ATTR_CMN_ADDEDTIME /usr/
    ATTR_CMN_ADDEDTIME = 1402841127.0 (Sun Jun 15 14:05:27 2014)
bash-3.2$ ~/bin/FSMegaInfo getattrlist -ATTR_CMN_ADDEDTIME /tmp/h/hfsCopiesAccurately/
getattrlist -ATTR_CMN_ADDEDTIME /tmp/h/hfsCopiesAccurately/
    ATTR_CMN_ADDEDTIME = 1447067081.0 (Mon Nov  9 11:04:41 2015)
bash-3.2$ ~/bin/FSMegaInfo getattrlist -ATTR_CMN_ADDEDTIME /Volumes/internal/xattrtest/z/zfsCopiesInaccurately/
getattrlist -ATTR_CMN_ADDEDTIME /Volumes/internal/xattrtest/z/zfsCopiesInaccurately/
    ATTR_CMN_ADDEDTIME = 1447067169.811639000 (Mon Nov  9 11:06:09 2015)
bash-3.2$

Note that all the directories, HFS+ and ZFS, have retrievable added time.

ilovezfs commented 8 years ago

@lundman on IRC lundman: yeah you confirmed it is ADDTIME lundman: hfs does have a bunch of tests as to when to copy it out

And indeed, 56 40 7E 21 -> 1447067169