aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/osd_client.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-08-15 01:51:58 -0400
committerSage Weil <sage@inktank.com>2013-08-27 15:26:30 -0400
commit1874119664dafda3ef2ed9b51b4759a9540d4a1a (patch)
treec0ef0813aeefd50703f2934abe752a2b4ebaad83 /net/ceph/osd_client.c
parentb314a90d8f3f1d16ec45744e5e2141ea6e14e034 (diff)
libceph: fix error handling in handle_reply()
We've tried to fix the error paths in this function before, but there is still a hidden goto in the ceph_decode_need() macro which goes to the wrong place. We need to release the "req" and unlock a mutex before returning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r--net/ceph/osd_client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 8ec65bc11c71..3ee4a1da02cd 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1495,14 +1495,14 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
1495 dout("handle_reply %p tid %llu req %p result %d\n", msg, tid, 1495 dout("handle_reply %p tid %llu req %p result %d\n", msg, tid,
1496 req, result); 1496 req, result);
1497 1497
1498 ceph_decode_need(&p, end, 4, bad); 1498 ceph_decode_need(&p, end, 4, bad_put);
1499 numops = ceph_decode_32(&p); 1499 numops = ceph_decode_32(&p);
1500 if (numops > CEPH_OSD_MAX_OP) 1500 if (numops > CEPH_OSD_MAX_OP)
1501 goto bad_put; 1501 goto bad_put;
1502 if (numops != req->r_num_ops) 1502 if (numops != req->r_num_ops)
1503 goto bad_put; 1503 goto bad_put;
1504 payload_len = 0; 1504 payload_len = 0;
1505 ceph_decode_need(&p, end, numops * sizeof(struct ceph_osd_op), bad); 1505 ceph_decode_need(&p, end, numops * sizeof(struct ceph_osd_op), bad_put);
1506 for (i = 0; i < numops; i++) { 1506 for (i = 0; i < numops; i++) {
1507 struct ceph_osd_op *op = p; 1507 struct ceph_osd_op *op = p;
1508 int len; 1508 int len;
@@ -1520,7 +1520,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
1520 goto bad_put; 1520 goto bad_put;
1521 } 1521 }
1522 1522
1523 ceph_decode_need(&p, end, 4 + numops * 4, bad); 1523 ceph_decode_need(&p, end, 4 + numops * 4, bad_put);
1524 retry_attempt = ceph_decode_32(&p); 1524 retry_attempt = ceph_decode_32(&p);
1525 for (i = 0; i < numops; i++) 1525 for (i = 0; i < numops; i++)
1526 req->r_reply_op_result[i] = ceph_decode_32(&p); 1526 req->r_reply_op_result[i] = ceph_decode_32(&p);