diff options
author | Sanoj Unnikrishnan <sunnikri@redhat.com> | 2017-02-01 19:15:29 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-02-06 06:36:24 -0500 |
commit | a3a38bb9cd2c17bd955489ae87800f398ef10239 (patch) | |
tree | 2411ef044630b3dde2b64633b0c6dcfd1706a496 /cli/src | |
parent | b3188c61d248526a070b1b18df1ea1d181b349d6 (diff) |
Fixes quota list when stale gfid exist in quota.conf
when an rmdir is done, the gfid corresponding to the dir remains
in quota.conf (if a limit was configured on the dir). The quota
list should ignore them and print the remaining limits. In case
the last gfid in quota.conf happened to be stale, the print code
was getting skipped. Refactored the code to ensure printing happens.
Change-Id: I3ac8e8a7a62d34e1fa8fd2734419459112c71797
BUG: 1418259
Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
Reviewed-on: https://review.gluster.org/16507
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Manikandan Selvaganesh <manikandancs333@gmail.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index b56457ecf63..7cdbaf0cad9 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -3951,14 +3951,6 @@ cli_quotad_getlimit_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - ret = dict_get_int32 (local->dict, "max_count", - &max_count); - if (ret < 0) { - gf_log ("cli", GF_LOG_ERROR, - "failed to get max_count"); - goto out; - } - node = list_node_add_order (dict, &local->dict_list, cli_quota_compare_path); if (node == NULL) { @@ -3968,17 +3960,28 @@ cli_quotad_getlimit_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - if (list_count == max_count) { - list_for_each_entry_safe (node, tmpnode, - &local->dict_list, list) { - dict = node->ptr; - print_quota_list_from_quotad (frame, dict); - list_node_del (node); - dict_unref (dict); - } + } + + ret = dict_get_int32 (local->dict, "max_count", + &max_count); + if (ret < 0) { + gf_log ("cli", GF_LOG_ERROR, + "failed to get max_count"); + goto out; + } + + if (list_count == max_count) { + list_for_each_entry_safe (node, tmpnode, + &local->dict_list, list) { + dict = node->ptr; + print_quota_list_from_quotad (frame, dict); + list_node_del (node); + dict_unref (dict); } } + + out: /* Bad Fix: CLI holds the lock to process a command. * When processing quota list command, below sequence of steps executed |