diff options
author | Manikandan Selvaganesh <mselvaga@redhat.com> | 2015-10-13 14:28:03 +0530 |
---|---|---|
committer | Kaushal M <kaushal@redhat.com> | 2015-10-14 23:42:46 -0700 |
commit | 0f72aa8668a6d2da4cce9cd04296454f2bc99d58 (patch) | |
tree | 3555b5dfab8a10674e55d633ab0360988c4888bb /cli | |
parent | 8629457bfc0347b0ad459ed0ce69a5f35c1314c7 (diff) |
cli/quota : rm -rf on /<mountpoint>/<dir> is not showing quota header
Currently, when 'gluster v quota <VOLNAME> list' command is issued
after an rm -rf on /run/gluster/vol/<directory>, quota output header is
not shown. It is because the list_count was properly calculated with
'gluster v quota <VOLNAME> remove /path' and not with an rm -rf. The patch
fixes this issue.
Backport of http://review.gluster.org/#/c/12345/
Cherry-picked from commit 00eeb153f4ea473c6636147f6c72c04336128198
> Change-Id: I5266a8b0b9322b7db1b9e1d6b0327065931f4bcb
> BUG: 1269375
> Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
> Reviewed-on: http://review.gluster.org/12345
> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
> Reviewed-by: Kaushal M <kaushal@redhat.com>
Change-Id: I5266a8b0b9322b7db1b9e1d6b0327065931f4bcb
BUG: 1271490
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/12356
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index ccd3b560ac4..d2372ef1483 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -3238,8 +3238,7 @@ out: } int -print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict, - int32_t list_count) +print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict) { char *path = NULL; char *default_sl = NULL; @@ -3250,6 +3249,7 @@ print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict, quota_limits_t limits = {0, }; quota_limits_t *size_limits = NULL; int32_t type = 0; + int32_t success_count = 0; GF_ASSERT (frame); @@ -3313,7 +3313,25 @@ print_quota_list_from_quotad (call_frame_t *frame, dict_t *rsp_dict, goto out; } - if (list_count == 0) { + LOCK (&local->lock); + { + ret = dict_get_int32 (gd_rsp_dict, "quota-list-success-count", + &success_count); + if (ret) + success_count = 0; + + ret = dict_set_int32 (gd_rsp_dict, + "quota-list-success-count", + success_count + 1); + } + UNLOCK (&local->lock); + if (ret) { + gf_log ("cli", GF_LOG_ERROR, "Failed to set " + "quota-list-success-count in dict"); + goto out; + } + + if (success_count == 0) { if (!(global_state->mode & GLUSTER_MODE_XML)) { print_quota_list_header (type); } else { @@ -3418,7 +3436,8 @@ cli_quotad_getlimit_cbk (struct rpc_req *req, struct iovec *iov, "unserialize req-buffer to dictionary"); goto out; } - print_quota_list_from_quotad (frame, dict, list_count); + + print_quota_list_from_quotad (frame, dict); } out: |