Skip to content

Commit f58f9d4

Browse files
committed
btrfs-progs: mkfs: fix printing of subvolumes in the summary
The subvolumes created during mkfs are not printed in the summary because btrfs_mkfs_fill_dir() deletes them from the list as they get created. Signed-off-by: David Sterba <[email protected]>
1 parent e73102e commit f58f9d4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

mkfs/main.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,6 +2076,12 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
20762076
pretty_size_mode(compression_level, UNITS_RAW) :
20772077
"");
20782078

2079+
/* Print subvolumes now as btrfs_mkfs_fill_dir() deletes the list. */
2080+
list_for_each_entry(rds, &subvols, list) {
2081+
pr_verbose(LOG_DEFAULT, " Subvolume: %s\n",
2082+
rds->full_path);
2083+
}
2084+
20792085
ret = btrfs_mkfs_fill_dir(trans, source_dir, root,
20802086
&subvols, compression,
20812087
compression_level);
@@ -2093,11 +2099,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
20932099
goto out;
20942100
}
20952101

2096-
list_for_each_entry(rds, &subvols, list) {
2097-
pr_verbose(LOG_DEFAULT, " Subvolume: %s\n",
2098-
rds->full_path);
2099-
}
2100-
21012102
if (shrink_rootdir) {
21022103
pr_verbose(LOG_DEFAULT, " Shrink: yes\n");
21032104
ret = btrfs_mkfs_shrink_fs(fs_info, &shrink_size,

0 commit comments

Comments
 (0)