From 1d77fe2458be6dc567435dc59bb94870cd0fe529 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 9 Jan 2012 15:43:10 +0530 Subject: glusterd/quota: inform the user if some quota command is executed without enabling it Change-Id: I676e52b0e0a9a6868eaa56d0309faa264e6e73be BUG: 771639 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.com/2609 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 5 +++++ xlators/mgmt/glusterd/src/glusterd-quota.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 3fb73946b..78b2980ad 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1721,6 +1721,11 @@ gf_cli3_1_quota_cbk (struct rpc_req *req, struct iovec *iov, gf_cli3_1_print_limit_list (volname, limit_list, rsp.op_errstr); + } else { + gf_log ("cli", GF_LOG_INFO, "Received resp to quota " + "command "); + if (rsp.op_errstr) + cli_out ("%s", rsp.op_errstr); } } else { gf_log ("cli", GF_LOG_INFO, "Received resp to quota command "); diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c index 881cf66b4..32264b7b6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-quota.c +++ b/xlators/mgmt/glusterd/src/glusterd-quota.c @@ -530,6 +530,13 @@ glusterd_quota_limit_usage (glusterd_volinfo_t *volinfo, dict_t *dict, char **op GF_VALIDATE_OR_GOTO ("glusterd", volinfo, out); GF_VALIDATE_OR_GOTO ("glusterd", op_errstr, out); + ret = glusterd_check_if_quota_trans_enabled (volinfo); + if (ret == -1) { + *op_errstr = gf_strdup ("Quota is disabled, please enable " + "quota"); + goto out; + } + ret = glusterd_volinfo_get (volinfo, VKEY_FEATURES_LIMIT_USAGE, "a_limits); if (ret) { -- cgit