aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/osd_client.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-01 19:58:26 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:17:51 -0400
commit8058fd45039724695d5b67a574544452635d64a9 (patch)
treee8b81188ec59a47e95846ac5857291554071cec8 /net/ceph/osd_client.c
parent3bf53337af27a3ccc6e0f433b081063cdf0a2bf6 (diff)
libceph: drop mutex on error in handle_reply()
The osd client mutex is acquired just before getting a reference to a request in handle_reply(). However the error paths after that don't drop the mutex before returning as they should. Drop the mutex after dropping the request reference. Also add a bad_mutex label at that point and use it so the failed request lookup case can be handled with the rest. This resolves: http://tracker.ceph.com/issues/4615 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r--net/ceph/osd_client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 55f7c9a57a43..69ef6539ca14 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1337,8 +1337,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
1337 req = __lookup_request(osdc, tid); 1337 req = __lookup_request(osdc, tid);
1338 if (req == NULL) { 1338 if (req == NULL) {
1339 dout("handle_reply tid %llu dne\n", tid); 1339 dout("handle_reply tid %llu dne\n", tid);
1340 mutex_unlock(&osdc->request_mutex); 1340 goto bad_mutex;
1341 return;
1342 } 1341 }
1343 ceph_osdc_get_request(req); 1342 ceph_osdc_get_request(req);
1344 1343
@@ -1437,6 +1436,8 @@ done:
1437 1436
1438bad_put: 1437bad_put:
1439 ceph_osdc_put_request(req); 1438 ceph_osdc_put_request(req);
1439bad_mutex:
1440 mutex_unlock(&osdc->request_mutex);
1440bad: 1441bad:
1441 pr_err("corrupt osd_op_reply got %d %d\n", 1442 pr_err("corrupt osd_op_reply got %d %d\n",
1442 (int)msg->front.iov_len, le32_to_cpu(msg->hdr.front_len)); 1443 (int)msg->front.iov_len, le32_to_cpu(msg->hdr.front_len));