summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2015-11-05 14:22:10 +0100
committerDavid Sterba <dsterba@suse.com>2015-11-05 14:49:02 +0100
commitf2c844f65ffdb6673467eb838049a48dc316dcaf (patch)
tree6219195aba6272b4801616bfcf2ea5c099cab87f /mkfs.c
parente8a5f57b69b583e0f15b931353aef98380b4e796 (diff)
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 <dsterba@suse.com>
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mkfs.c b/mkfs.c
index 72ee2904..0ea39f38 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;