From 253cd12f41a12e11e3fdcd40601335f8c25110de Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 7 Sep 2016 15:31:27 +0200 Subject: [PATCH] btrfs-progs: tree-stats: check and report mount status Signed-off-by: David Sterba --- cmds-inspect-tree-stats.c | 16 ++++++---------- 1 file 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) { -- 2.7.4