summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-09-07 15:31:27 +0200
committerDavid Sterba <dsterba@suse.com>2016-09-21 11:47:55 +0200
commit253cd12f41a12e11e3fdcd40601335f8c25110de (patch)
tree81115b13f787e679ebdc0c1fd2a847c46702e7a9
parent67786272eaed79f3803847f6bca573cea4be16a9 (diff)
btrfs-progs: tree-stats: check and report mount status
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--cmds-inspect-tree-stats.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/cmds-inspect-tree-stats.c b/cmds-inspect-tree-stats.c
index c35f588..cd7ef3b 100644
--- a/cmds-inspect-tree-stats.c
+++ b/cmds-inspect-tree-stats.c
@@ -457,18 +457,14 @@ int cmd_inspect_tree_stats(int argc, char **argv)
usage(cmd_inspect_tree_stats_usage);
}
- /*
- if ((ret = check_mounted(argv[optind])) < 0) {
- fprintf(stderr, "Could not check mount status: %d\n", ret);
- if (ret == -EACCES)
- fprintf(stderr, "Maybe you need to run as root?\n");
- return ret;
+ ret = check_mounted(argv[optind]);
+ if (ret < 0) {
+ warning("unable to check mount status of: %s",
+ strerror(-ret));
} else if (ret) {
- fprintf(stderr, "%s is currently mounted. Aborting.\n",
- argv[optind]);
- return -EBUSY;
+ warning("%s already mounted, results may be inaccurate",
+ argv[optind]);
}
- */
root = open_ctree(argv[optind], 0, 0);
if (!root) {