From 2fd0f3a98040a9744869d7c50f744250b1cac6fe Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Wed, 29 Nov 2017 14:31:39 +0800 Subject: 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 Signed-off-by: David Sterba --- mkfs/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mkfs/main.c') 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]; -- cgit v1.2.3