summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanoj Unnikrishnan <sunnikri@redhat.com>2017-02-01 19:15:29 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-03-01 02:04:21 +0000
commitf21a8a0bee1c92961c2aa4dc5a059571ddcec3eb (patch)
tree55ef73a6430bfa8b7214f52b4c2ca02173f3233a
parent64ad9a8d2712a49e1bbaa0047007e58eb72d4384 (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> Change-Id: I3ac8e8a7a62d34e1fa8fd2734419459112c71797 BUG: 1549482 Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
-rw-r--r--cli/src/cli-rpc-ops.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index bb7c347..18112a5 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -3972,14 +3972,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) {
@@ -3989,17 +3981,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