From f2c844f65ffdb6673467eb838049a48dc316dcaf Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 5 Nov 2015 14:22:10 +0100 Subject: btrfs-progs: mkfs: do not truncate the image when --rootdir is set With the rootdir option we try to guess the final size of the image and fill it with zeros, preceded by truncation. After patch "Btrfs-progs: Do not force mixed block group creation unless '-M' option is specified" the misc test 002 will fail, because of the non-mixed mode. I think we should not touch the image size (no change for block devices) and try to fit into whatever is provided by user. Signed-off-by: David Sterba --- mkfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkfs.c') diff --git a/mkfs.c b/mkfs.c index 72ee290..0ea39f3 100644 --- a/mkfs.c +++ b/mkfs.c @@ -926,7 +926,7 @@ fail_no_dir: static int open_target(char *output_name) { int output_fd; - output_fd = open(output_name, O_CREAT | O_RDWR | O_TRUNC, + output_fd = open(output_name, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); return output_fd; -- cgit v1.2.1