summaryrefslogtreecommitdiffstats
path: root/net/ceph/osd_client.c
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2014-06-20 14:14:42 +0400
committerIlya Dryomov <ilya.dryomov@inktank.com>2014-07-08 15:08:43 +0400
commit6562d661d205ff9bd855345d6424b9fb07adaf62 (patch)
tree8cfb45d6aa665360d1044609f3a4caee667b3e69 /net/ceph/osd_client.c
parent9e94af202afd961da39f82b55ba83edd4ad30e98 (diff)
downloadlinux-6562d661d205ff9bd855345d6424b9fb07adaf62.tar.gz
linux-6562d661d205ff9bd855345d6424b9fb07adaf62.tar.bz2
linux-6562d661d205ff9bd855345d6424b9fb07adaf62.zip
libceph: harden ceph_osdc_request_release() a bit
Add some WARN_ONs to alert us when we try to destroy requests that are still registered. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r--net/ceph/osd_client.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 7406046212dc..052eb8bfcc74 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -305,6 +305,12 @@ static void ceph_osdc_release_request(struct kref *kref)
dout("%s %p (r_request %p r_reply %p)\n", __func__, req,
req->r_request, req->r_reply);
+ WARN_ON(!RB_EMPTY_NODE(&req->r_node));
+ WARN_ON(!list_empty(&req->r_req_lru_item));
+ WARN_ON(!list_empty(&req->r_osd_item));
+ WARN_ON(!list_empty(&req->r_linger_item));
+ WARN_ON(!list_empty(&req->r_linger_osd_item));
+ WARN_ON(req->r_osd);
if (req->r_request)
ceph_msg_put(req->r_request);
@@ -1204,6 +1210,7 @@ static void __unregister_request(struct ceph_osd_client *osdc,
dout("__unregister_request %p tid %lld\n", req, req->r_tid);
rb_erase(&req->r_node, &osdc->requests);
+ RB_CLEAR_NODE(&req->r_node);
osdc->num_requests--;
if (req->r_osd) {