mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-26 16:12:34 +00:00
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>
This commit is contained in:
parent
41bc987511
commit
2fd0f3a980
13
mkfs/main.c
13
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];
|
||||
|
Loading…
Reference in New Issue
Block a user