summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Hubbard <bhubbard@redhat.com>2015-08-19 18:56:06 +1000
committerAtin Mukherjee <amukherj@redhat.com>2015-09-01 00:01:04 -0700
commit4b5aec8da9be69da077e1fcc7e852d224517ecc0 (patch)
tree522c537f0f1879175f0698377290c33e9add7542
parent4c6d1c0dc7e5f51c7f3d477fb274517d57289276 (diff)
glusterd: Return better error messages for probe and detach failures
We handle some specific errors and return good error messages for those, but for the default case where the error code is not recognised we just report "unknown errno". This patch attempts to at least return the output of strerror to provide more informative errors. BUG: 1257149 Change-Id: I0027e74e41adac4ab0c0a929c6fff56878bf39c8 Signed-off-by: Brad Hubbard <bhubbard@redhat.com> Reviewed-on: http://review.gluster.org/12021 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
-rwxr-xr-xtests/bugs/glusterfs/bug-879490.t2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/bugs/glusterfs/bug-879490.t b/tests/bugs/glusterfs/bug-879490.t
index 7cec671..c254b4f 100755
--- a/tests/bugs/glusterfs/bug-879490.t
+++ b/tests/bugs/glusterfs/bug-879490.t
@@ -25,7 +25,7 @@ function peer_probe()
$CLI peer probe a.b.c.d --xml | xmllint --format - | grep "<opErrstr>"
}
-EXPECT " <opErrstr>Probe returned with unknown errno 107</opErrstr>" peer_probe
+EXPECT " <opErrstr>Probe returned with Transport endpoint is not connected</opErrstr>" peer_probe
## Finish up
TEST $CLI volume stop $V0;
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 911bab9..3494585 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -3799,8 +3799,8 @@ set_probe_error_str (int op_ret, int op_errno, char *op_errstr, char *errstr,
default:
if (op_errno != 0)
snprintf (errstr, len, "Probe returned "
- "with unknown errno %d",
- op_errno);
+ "with %s",
+ strerror (op_errno));
break;
}
} else {
@@ -3854,7 +3854,7 @@ set_probe_error_str (int op_ret, int op_errno, char *op_errstr, char *errstr,
default:
snprintf (errstr, len, "Probe returned with "
- "unknown errno %d", op_errno);
+ "%s", strerror (op_errno));
break;
}
}
@@ -3950,7 +3950,7 @@ set_deprobe_error_str (int op_ret, int op_errno, char *op_errstr, char *errstr,
break;
default:
snprintf (errstr, len, "Detach returned with "
- "unknown errno %d", op_errno);
+ "%s", strerror (op_errno));
break;
}