Re: [PATCH] btrfs-progs: mkfs/rootdir: Don't follow symbolic link when calcuating size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 28, 2018 at 02:39:09PM +0800, Qu Wenruo wrote:
> [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.
> 
> Reported-by: Alexander Kanavin <alexander.kanavin@xxxxxxxxx>
> Fixes: 599a0abed564 ("btrfs-progs: mkfs/rootdir: Use over-reserve method to make size estimate easier")
> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>

Applied, thanks. Can you please write a testcase for that?
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux