diff options
-rw-r--r-- | include/linux/ceph/osd_client.h | 1 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 17 |
2 files changed, 8 insertions, 10 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 186db0bf4951..ce6df39f60ff 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
@@ -145,7 +145,6 @@ struct ceph_osd_request { | |||
145 | s32 r_reply_op_result[CEPH_OSD_MAX_OP]; | 145 | s32 r_reply_op_result[CEPH_OSD_MAX_OP]; |
146 | int r_got_reply; | 146 | int r_got_reply; |
147 | int r_linger; | 147 | int r_linger; |
148 | int r_completed; | ||
149 | 148 | ||
150 | struct ceph_osd_client *r_osdc; | 149 | struct ceph_osd_client *r_osdc; |
151 | struct kref r_kref; | 150 | struct kref r_kref; |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index d127e36b4964..10e947cbc478 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -1522,6 +1522,8 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
1522 | for (i = 0; i < numops; i++) | 1522 | for (i = 0; i < numops; i++) |
1523 | req->r_reply_op_result[i] = ceph_decode_32(&p); | 1523 | req->r_reply_op_result[i] = ceph_decode_32(&p); |
1524 | 1524 | ||
1525 | already_completed = req->r_got_reply; | ||
1526 | |||
1525 | if (!req->r_got_reply) { | 1527 | if (!req->r_got_reply) { |
1526 | 1528 | ||
1527 | req->r_result = result; | 1529 | req->r_result = result; |
@@ -1552,16 +1554,14 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
1552 | ((flags & CEPH_OSD_FLAG_WRITE) == 0)) | 1554 | ((flags & CEPH_OSD_FLAG_WRITE) == 0)) |
1553 | __unregister_request(osdc, req); | 1555 | __unregister_request(osdc, req); |
1554 | 1556 | ||
1555 | already_completed = req->r_completed; | ||
1556 | req->r_completed = 1; | ||
1557 | mutex_unlock(&osdc->request_mutex); | 1557 | mutex_unlock(&osdc->request_mutex); |
1558 | if (already_completed) | ||
1559 | goto done; | ||
1560 | 1558 | ||
1561 | if (req->r_callback) | 1559 | if (!already_completed) { |
1562 | req->r_callback(req, msg); | 1560 | if (req->r_callback) |
1563 | else | 1561 | req->r_callback(req, msg); |
1564 | complete_all(&req->r_completion); | 1562 | else |
1563 | complete_all(&req->r_completion); | ||
1564 | } | ||
1565 | 1565 | ||
1566 | if (flags & CEPH_OSD_FLAG_ONDISK) | 1566 | if (flags & CEPH_OSD_FLAG_ONDISK) |
1567 | complete_request(req); | 1567 | complete_request(req); |
@@ -2121,7 +2121,6 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc, | |||
2121 | __register_request(osdc, req); | 2121 | __register_request(osdc, req); |
2122 | req->r_sent = 0; | 2122 | req->r_sent = 0; |
2123 | req->r_got_reply = 0; | 2123 | req->r_got_reply = 0; |
2124 | req->r_completed = 0; | ||
2125 | rc = __map_request(osdc, req, 0); | 2124 | rc = __map_request(osdc, req, 0); |
2126 | if (rc < 0) { | 2125 | if (rc < 0) { |
2127 | if (nofail) { | 2126 | if (nofail) { |