summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-03-27 17:09:08 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-30 23:56:04 -0700
commit78474f8fab91affae7207d2704aa5a595b871982 (patch)
treea898eadf7d5b18d57bf291ef89a28f53961292e6
parentffb2e85ff574891639d899cc59fcd9f75d4ce51e (diff)
quota/cli: improve cli error message when setting limit on invalid path
Change-Id: I5976777adf770d42aa33ebbe3833fb14c1ff658e BUG: 1206535 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/10026 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--cli/src/cli-rpc-ops.c8
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index c9b01694436..5471291ab63 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -3121,10 +3121,14 @@ gf_cli_quota_cbk (struct rpc_req *req, struct iovec *iov,
if (global_state->mode & GLUSTER_MODE_XML)
goto xml_output;
- if (strcmp (rsp.op_errstr, ""))
+ if (strcmp (rsp.op_errstr, "")) {
cli_err ("quota command failed : %s", rsp.op_errstr);
- else
+ if (rsp.op_ret == -ENOENT)
+ cli_err ("please enter the path relative to "
+ "the volume");
+ } else {
cli_err ("quota command : failed");
+ }
goto out;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 243703786e9..65bd4044164 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -9260,7 +9260,7 @@ glusterd_validate_and_set_gfid (dict_t *op_ctx, dict_t *req_dict,
gf_asprintf (op_errstr, "Failed to get trusted.gfid attribute "
"on path %s. Reason : %s", path,
strerror (ENOENT));
- ret = -1;
+ ret = -ENOENT;
goto out;
}