From dddc3e08cbf87c1ab06f4fa55a108e538db42f8b Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 13 Jan 2016 18:14:32 +0100 Subject: [PATCH] btrfs-progs: more verbose errors from test_issubvolume Signed-off-by: David Sterba --- cmds-qgroup.c | 2 +- cmds-subvolume.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index eca4464..db5ee21 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -434,7 +434,7 @@ static int cmd_qgroup_limit(int argc, char **argv) path = argv[optind + 1]; ret = test_issubvolume(path); if (ret < 0) { - error("cannot access '%s'", path); + error("cannot access '%s': %s", path, strerror(-ret)); return 1; } if (!ret) { diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 9866c77..d5ec886 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -325,7 +325,7 @@ again: res = test_issubvolume(path); if (res < 0) { - error("cannot access subvolume %s", path); + error("cannot access subvolume %s: %s", path, strerror(-res)); ret = 1; goto out; } @@ -680,7 +680,7 @@ static int cmd_subvol_snapshot(int argc, char **argv) retval = 1; /* failure */ res = test_issubvolume(subvol); if (res < 0) { - error("cannot access subvolume %s", subvol); + error("cannot access subvolume %s: %s", subvol, strerror(-res)); goto out; } if (!res) { @@ -886,7 +886,7 @@ static int cmd_subvol_find_new(int argc, char **argv) ret = test_issubvolume(subvol); if (ret < 0) { - error("cannot access subvolume %s", subvol); + error("cannot access subvolume %s: %s", subvol, strerror(-ret)); return 1; } if (!ret) { @@ -957,7 +957,8 @@ static int cmd_subvol_show(int argc, char **argv) ret = test_issubvolume(fullpath); if (ret < 0) { - error("cannot access subvolume %s", fullpath); + error("cannot access subvolume %s: %s", fullpath, + strerror(-ret)); goto out; } if (!ret) { -- 2.7.4