Skip to content

Commit

Permalink
ceph: revoke osd request message on request completion
Browse files Browse the repository at this point in the history
If an osd has failed or returned and a request has been sent twice, it's
possible to get a reply and unregister the request while the request
message is queued for delivery.  Since the message references the caller's
page vector, we need to revoke it before completing.

Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Oct 9, 2009
1 parent c1ea882 commit 0ba6478
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions fs/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,15 @@ static void __unregister_request(struct ceph_osd_client *osdc,
rb_erase(&req->r_node, &osdc->requests);
osdc->num_requests--;

list_del_init(&req->r_osd_item);
if (list_empty(&req->r_osd->o_requests))
remove_osd(osdc, req->r_osd);
req->r_osd = NULL;
if (req->r_osd) {
/* make sure the original request isn't in flight. */
ceph_con_revoke(&req->r_osd->o_con, req->r_request);

list_del_init(&req->r_osd_item);
if (list_empty(&req->r_osd->o_requests))
remove_osd(osdc, req->r_osd);
req->r_osd = NULL;
}

ceph_osdc_put_request(req);

Expand Down

0 comments on commit 0ba6478

Please sign in to comment.