diff options
author | Alex Elder <elder@inktank.com> | 2013-02-27 10:26:25 -0600 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-01 21:16:12 -0700 |
commit | 0d5af1643535508f82d6bcc2b9b93b180e8c3f4b (patch) | |
tree | 723493b46491da26aa66cc60604f11e701d32858 /net/ceph/osd_client.c | |
parent | 3f99969f42300e52779ae0656678c2534097f2ea (diff) |
libceph: complete lingering requests only once
An osd request marked to linger will be re-submitted in the event
a connection to the target osd gets dropped. Currently, if there
is a callback function associated with a request it will be called
each time a request is submitted--which for lingering requests can
be more than once.
Change it so a request--including lingering ones--will get completed
(from the perspective of the user of the osd client) exactly once.
This resolves:
http://tracker.ceph.com/issues/3967
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r-- | net/ceph/osd_client.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 1d9ebf967b0..a28c976ae3a 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -1174,6 +1174,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, u32 reassert_epoch; u64 reassert_version; u32 osdmap_epoch; + int already_completed; int i; tid = le64_to_cpu(msg->hdr.tid); @@ -1282,7 +1283,11 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, ((flags & CEPH_OSD_FLAG_WRITE) == 0)) __unregister_request(osdc, req); + already_completed = req->r_completed; + req->r_completed = 1; mutex_unlock(&osdc->request_mutex); + if (already_completed) + goto done; if (req->r_callback) req->r_callback(req, msg); |