Skip to content

Commit 680584f

Browse files
author
Alex Elder
committed
libceph: osd_client: don't drop reply reference too early
In ceph_osdc_release_request(), a reference to the r_reply message is dropped. But just after that, that same message is revoked if it was in use to receive an incoming reply. Reorder these so we are sure we hold a reference until we're actually done with the message. Signed-off-by: Alex Elder <[email protected]> Reviewed-by: Sage Weil <[email protected]> (cherry picked from commit ab8cb34)
1 parent 61600ef commit 680584f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ceph/osd_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ void ceph_osdc_release_request(struct kref *kref)
139139

140140
if (req->r_request)
141141
ceph_msg_put(req->r_request);
142-
if (req->r_reply)
143-
ceph_msg_put(req->r_reply);
144142
if (req->r_con_filling_msg) {
145143
dout("release_request revoking pages %p from con %p\n",
146144
req->r_pages, req->r_con_filling_msg);
147145
ceph_con_revoke_message(req->r_con_filling_msg,
148146
req->r_reply);
149147
ceph_con_put(req->r_con_filling_msg);
150148
}
149+
if (req->r_reply)
150+
ceph_msg_put(req->r_reply);
151151
if (req->r_own_pages)
152152
ceph_release_page_vector(req->r_pages,
153153
req->r_num_pages);

0 commit comments

Comments
 (0)