0af60b1faf
[BUG] When using "mkfs.btrfs" with "--rootdir" option, the top level inode (rootdir) will not get the same xattr from the source dir: mkdir -p source_dir/ touch source_dir/file setfattr -n user.rootdir_xattr source_dir/ setfattr -n user.regular_xattr source_dir/file mkfs.btrfs -f --rootdir source_dir $dev mount $dev $mnt getfattr $mnt # Nothing <<< getfattr $mnt/file # file: $mnt/file user.regular_xattr <<< [CAUSE] In function traverse_directory(), we only call add_xattr_item() for all the child inodes, not really for the rootdir inode itself, leading to the missing xattr items. Not only xattr, in fact we also miss the uid/gid/timestamps/mode for the rootdir inode. [FIX] Extract a dedicated function, copy_rootdir_inode(), to handle every needed attributes for the rootdir inode, including: - xattr - uid - gid - mode - timestamps Issue: #688 Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
common.c | ||
common.h | ||
main.c | ||
Makefile | ||
rootdir.c | ||
rootdir.h |