summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2018-03-28 14:39:09 +0800
committerDavid Sterba <dsterba@suse.com>2018-03-30 22:15:55 +0200
commit4e6e5804f2153efc85cfd1efaeabbaa5b7e8c02e (patch)
tree05b1f34d96d64e5f64eafd67280096279aa1499c /cmds-filesystem.c
parent3fd6a955f91cfd0fabdab8ab441938879f7d692d (diff)
btrfs-progs: mkfs/rootdir: Don't follow symbolic link when calcuating size
[BUG] If we have a symbolic link in rootdir pointing to non-existing location, mkfs.btrfs --rootdir will just fail: ------ $ mkfs.btrfs -f --rootdir /tmp/rootdir/ /dev/data/btrfs btrfs-progs v4.15.1 See http://btrfs.wiki.kernel.org for more information. ERROR: ftw subdir walk of /tmp/rootdir/ failed: No such file or directory ------ [CAUSE] Commit 599a0abed564 ("btrfs-progs: mkfs/rootdir: Use over-reserve method to make size estimate easier") add extra ftw walk to estimate the filesystem size. Such default ftw walk will follow symbolic link and gives ENOENT error. [FIX] Use nftw() to specify FTW_PHYS so we won't follow symbolic link for size calculation. Issue: #109 Reported-by: Alexander Kanavin <alexander.kanavin@intel.com> Fixes: 599a0abed564 ("btrfs-progs: mkfs/rootdir: Use over-reserve method to make size estimate easier") Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-filesystem.c')
0 files changed, 0 insertions, 0 deletions