Skip to content

Commit 1046beb

Browse files
committed
btrfs-progs: inspect tree-stats: rephrase warning when run on a mounted filesystem
Running 'btrfs inspect tree-stats' on a mounted filesystem works though it reads directly from block devices. This can lead to inconsistent data, warnings, errors or or a crash. More checks could be added but at least explain things in more detail. Issue: kdave#520 Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 938c6a1 commit 1046beb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmds/inspect-tree-stats.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,9 @@ static int cmd_inspect_tree_stats(const struct cmd_struct *cmd,
468468
errno = -ret;
469469
warning("unable to check mount status of: %m");
470470
} else if (ret) {
471-
warning("%s already mounted, results may be inaccurate",
472-
argv[optind]);
471+
warning("%s already mounted, tree-stats accesses the block devices directly, this may\n"
472+
"\tresult in inaccurate numbers, various errors or it may crash if the filesystem\n"
473+
"\tchanges unexpectedly, restart if needed or remount read-only", argv[optind]);
473474
}
474475

475476
root = open_ctree(argv[optind], 0, 0);

0 commit comments

Comments
 (0)