summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/mkfs.c b/mkfs.c
index 5d662e43..69df39b7 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1409,6 +1409,17 @@ int main(int ac, char **av)
file = av[optind++];
ssd = is_ssd(file);
+ if (is_vol_small(file)) {
+ printf("SMALL VOLUME: forcing mixed metadata/data groups\n");
+ mixed = 1;
+ if (metadata_profile != data_profile) {
+ if (metadata_profile_opt || data_profile_opt) {
+ fprintf(stderr,
+ "With mixed block groups data and metadata profiles must be the same\n");
+ exit(1);
+ }
+ }
+ }
/*
* Set default profiles according to number of added devices.
* For mixed groups defaults are single/single.
@@ -1429,7 +1440,6 @@ int main(int ac, char **av)
BTRFS_BLOCK_GROUP_RAID0 : 0; /* raid0 or single */
}
} else {
- /* this is not needed but just for completeness */
metadata_profile = 0;
data_profile = 0;
}
@@ -1488,14 +1498,6 @@ int main(int ac, char **av)
}
- if (mixed) {
- if (metadata_profile != data_profile) {
- fprintf(stderr, "With mixed block groups data and metadata "
- "profiles must be the same\n");
- exit(1);
- }
- }
-
blocks[0] = BTRFS_SUPER_INFO_OFFSET;
for (i = 1; i < 7; i++) {
blocks[i] = BTRFS_SUPER_INFO_OFFSET + 1024 * 1024 +