Skip to content

Commit 09a5ad0

Browse files
committed
btrfs-progs: check: add more progress or error messages
Some steps don't seem to have a message printed when they start, like the tree-log clearing or checksum fill phase. Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 4f17b3a commit 09a5ad0

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

check/main.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10373,6 +10373,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1037310373
err |= !!ret;
1037410374
goto close_out;
1037510375
}
10376+
pr_verbose(LOG_DEFAULT, "Clearing tree-log\n");
1037610377
ret = zero_log_tree(root);
1037710378
err |= !!ret;
1037810379
if (ret) {
@@ -10382,8 +10383,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1038210383
}
1038310384

1038410385
if (qgroup_report) {
10385-
printf("Print quota groups for %s\nUUID: %s\n", argv[optind],
10386-
uuidbuf);
10386+
printf("Print quota groups report for %s\nUUID: %s\n", argv[optind], uuidbuf);
1038710387
ret = qgroup_verify_all(gfs_info);
1038810388
err |= !!ret;
1038910389
if (ret >= 0)
@@ -10440,6 +10440,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1044010440
goto close_out;
1044110441
}
1044210442

10443+
pr_verbose(LOG_DEFAULT, "Fill checksum tree\n");
1044310444
ret = fill_csum_tree(trans, init_extent_tree);
1044410445
err |= !!ret;
1044510446
if (ret) {
@@ -10453,8 +10454,11 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1045310454
*/
1045410455
ret = btrfs_commit_transaction(trans, gfs_info->tree_root);
1045510456
err |= !!ret;
10456-
if (ret)
10457+
if (ret) {
10458+
errno = -ret;
10459+
error_msg(ERROR_MSG_COMMIT_TRANS, "%m");
1045710460
goto close_out;
10461+
}
1045810462
}
1045910463

1046010464
ret = check_global_roots_uptodate();
@@ -10513,8 +10517,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
1051310517
task_stop(g_task_ctx.info);
1051410518
err |= !!ret;
1051510519
if (ret)
10516-
error(
10517-
"errors found in extent allocation tree or chunk allocation");
10520+
error("errors found in extent allocation tree or chunk allocation");
1051810521

1051910522
/* Only re-check super size after we checked and repaired the fs */
1052010523
err |= !is_super_size_valid();

check/mode-common.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,12 @@ int recow_extent_buffer(struct btrfs_root *root, struct extent_buffer *eb)
10701070
}
10711071

10721072
trans = btrfs_start_transaction(root, 1);
1073-
if (IS_ERR(trans))
1074-
return PTR_ERR(trans);
1073+
if (IS_ERR(trans)) {
1074+
ret = PTR_ERR(trans);
1075+
errno = -ret;
1076+
error_msg(ERROR_MSG_START_TRANS, "%m");
1077+
return ret;
1078+
}
10751079

10761080
path.lowest_level = btrfs_header_level(eb);
10771081
if (path.lowest_level)

0 commit comments

Comments
 (0)