diff options
author | Yuan Ding <beback198611@gmail.com> | 2014-04-21 22:10:13 +0800 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-04-28 00:50:24 -0700 |
commit | 49733d307f010bfeb3d2440402ff51a5366262f5 (patch) | |
tree | 897cd27bbed68a8550a1cac028d29cd3a2c5b0c4 | |
parent | 22f47322d246c94d0bec8e893e4837a67d39f544 (diff) |
gNFS: gNFS drc cache failed to detecte duplicates.
After the drc cache get full, message "DRC failed to detect duplicates" keep
printed in the log.
The root cause is drc_compare_reqs use the wrong compare type. This function
should use type drc_cache_op_t as its input type. Since all rbtree related code
(except function rpcsvc_drc_lookup) in drc cache pass drc_cache_op_t as compare
type. Only rpcsvc_drc_lookup use type rpcsvc_request_t. It has been modified
too.
Change-Id: I925c097debe6b82f267986961fd4e7755f3de9af
BUG: 1089676
Signed-off-by: Yuan Ding <beback198611@gmail.com>
Reviewed-on: http://review.gluster.org/7519
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Santosh Pradhan <spradhan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r-- | rpc/rpc-lib/src/rpc-drc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/rpc/rpc-lib/src/rpc-drc.c b/rpc/rpc-lib/src/rpc-drc.c index 0babb9bc43c..bc37324d391 100644 --- a/rpc/rpc-lib/src/rpc-drc.c +++ b/rpc/rpc-lib/src/rpc-drc.c @@ -127,14 +127,14 @@ int drc_compare_reqs (const void *item, const void *rb_node_data, void *param) { int ret = -1; - rpcsvc_request_t *req = NULL; + drc_cached_op_t *req = NULL; drc_cached_op_t *reply = NULL; GF_ASSERT (item); GF_ASSERT (rb_node_data); GF_ASSERT (param); - req = (rpcsvc_request_t *)item; + req = (drc_cached_op_t *)item; reply = (drc_cached_op_t *)rb_node_data; ret = req->xid - reply->xid; @@ -143,7 +143,7 @@ drc_compare_reqs (const void *item, const void *rb_node_data, void *param) if (req->prognum == reply->prognum && req->procnum == reply->procnum && - req->progver == reply->progversion) + req->progversion == reply->progversion) return 0; return 1; @@ -331,6 +331,12 @@ rpcsvc_drc_lookup (rpcsvc_request_t *req) { drc_client_t *client = NULL; drc_cached_op_t *reply = NULL; + drc_cached_op_t new = { + .xid = req->xid, + .prognum = req->prognum, + .progversion = req->progver, + .procnum = req->procnum, + }; GF_ASSERT (req); @@ -347,7 +353,7 @@ rpcsvc_drc_lookup (rpcsvc_request_t *req) if (client->op_count == 0) goto out; - reply = rb_find (client->rbtree, req); + reply = rb_find (client->rbtree, &new); out: if (client) |