summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2017-11-29 14:31:39 +0800
committerDavid Sterba <dsterba@suse.com>2018-01-08 18:11:38 +0100
commit2fd0f3a98040a9744869d7c50f744250b1cac6fe (patch)
tree136af4387a8d0417c4f52e333ce8dd4d4ef6c7c6
parent41bc9875115448cce991867e7b7160477e92b272 (diff)
btrfs-progs: mkfs: Cleanup temporary chunks before filling rootdir
Cleanup of temporary chunks should be done as soon as possible, and it should be especially before doing large tree operations, like filling the filesystem when using --rootdir. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--mkfs/main.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mkfs/main.c b/mkfs/main.c
index 5b5193d5..ec6b2f85 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1223,6 +1223,13 @@ raid_groups:
goto out;
}
+ ret = cleanup_temp_chunks(fs_info, &allocation, data_profile,
+ metadata_profile, metadata_profile);
+ if (ret < 0) {
+ error("failed to cleanup temporary chunks: %d", ret);
+ goto out;
+ }
+
if (source_dir_set) {
trans = btrfs_start_transaction(root, 1);
BUG_ON(IS_ERR(trans));
@@ -1245,12 +1252,6 @@ raid_groups:
goto out;
}
}
- ret = cleanup_temp_chunks(fs_info, &allocation, data_profile,
- metadata_profile, metadata_profile);
- if (ret < 0) {
- error("failed to cleanup temporary chunks: %d", ret);
- goto out;
- }
if (verbose) {
char features_buf[64];