From: David O. <go...@in...> - 2019-06-09 23:46:04
|
Thanks for checking it out! On 6/9/19 8:58 AM, Guan Xin wrote: > BTW, "empty directories cannot have xattrs" -- Might actually be implemented. > Just tried with squash-tools 4.3 with setfattr on empty dir/mksquashfs > -xattrs/mount > and getfattr succeeded. My concern was that a directory needs to have an LDIR inode to have xattrs. The LDIR inode requires a directory index, which (in theory) cannot be empty (count is off by 1, so count=0 means 1 entry). I took a look at the mksquashfs source again and examined a sample file system with a hex editor. The index count is simply set to 0 but the index is omitted. The kernel and unsquashfs don't seem to bother since the directory has size 0. It feels very much like this is working out by chance rather than by design. Anyway, I went ahead and patched the gensquahfs tool to do the same. Thanks, David |