From 0855a8cd43006c38441729ce950a086745deab16 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Wed, 29 Nov 2017 16:07:34 +0800 Subject: btrfs-progs: mkfs: fix regression preventing --rootdir to create file Commit 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs") will try to check the file state before creating fs on it. The check is mostly fine for normal mkfs case, while for --rootdir option, it's allowed to create a new file if the destination file doesn't exist. Fix it by allowing non-existent file if --rootdir is specified. Fixes: 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs") Signed-off-by: Qu Wenruo Reviewed-by: Tomohiro Misono Signed-off-by: David Sterba --- utils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'utils.h') diff --git a/utils.h b/utils.h index a82d46f6..860c25d3 100644 --- a/utils.h +++ b/utils.h @@ -122,6 +122,7 @@ int set_label(const char *btrfs_dev, const char *label); char *__strncpy_null(char *dest, const char *src, size_t n); int is_block_device(const char *file); int is_mount_point(const char *file); +int is_path_exist(const char *file); int check_arg_type(const char *input); int open_path_or_dev_mnt(const char *path, DIR **dirstream, int verbose); int btrfs_open(const char *path, DIR **dirstream, int verbose, int dir_only); -- cgit v1.2.3