Skip to content

Commit

Permalink
libceph: harden ceph_osdc_request_release() a bit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
idryomov committed Jul 8, 2014
1 parent 9e94af2 commit 6562d66
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6562d66

Please sign in to comment.