diff options
author | Alex Elder <elder@inktank.com> | 2013-04-01 23:58:26 (GMT) |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 04:17:51 (GMT) |
commit | 8058fd45039724695d5b67a574544452635d64a9 (patch) | |
tree | e8b81188ec59a47e95846ac5857291554071cec8 /net/ceph/osd_client.c | |
parent | 3bf53337af27a3ccc6e0f433b081063cdf0a2bf6 (diff) | |
download | linux-fsl-qoriq-8058fd45039724695d5b67a574544452635d64a9.tar.xz |
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.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 55f7c9a..69ef653 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, req = __lookup_request(osdc, tid); if (req == NULL) { dout("handle_reply tid %llu dne\n", tid); - mutex_unlock(&osdc->request_mutex); - return; + goto bad_mutex; } ceph_osdc_get_request(req); @@ -1437,6 +1436,8 @@ done: bad_put: ceph_osdc_put_request(req); +bad_mutex: + mutex_unlock(&osdc->request_mutex); bad: pr_err("corrupt osd_op_reply got %d %d\n", (int)msg->front.iov_len, le32_to_cpu(msg->hdr.front_len)); |