btrfs-progs: mkfs: do not truncate the image when --rootdir is set
authorDavid Sterba <dsterba@suse.com>
Thu, 5 Nov 2015 13:22:10 +0000 (14:22 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 5 Nov 2015 13:49:02 +0000 (14:49 +0100)
commitf2c844f65ffdb6673467eb838049a48dc316dcaf
tree6219195aba6272b4801616bfcf2ea5c099cab87f
parente8a5f57b69b583e0f15b931353aef98380b4e796
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>
mkfs.c
tests/mkfs-tests/004-rootdir-keeps-size/test.sh [new file with mode: 0755]