Commit dc045a91 authored by Ilya Dryomov's avatar Ilya Dryomov

libceph: put request only if it's done in handle_reply()

handle_reply() may be called twice on the same request: on ack and then
on commit.  This occurs on btrfs-formatted OSDs or if cephfs sync write
path is triggered - CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK.

handle_reply() handles this with the help of done_request().

Fixes: 5aea3dcd ("libceph: a major OSD client update")
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent b7ec35b3
...@@ -2892,6 +2892,9 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg) ...@@ -2892,6 +2892,9 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg)
dout("req %p tid %llu cb\n", req, req->r_tid); dout("req %p tid %llu cb\n", req, req->r_tid);
__complete_request(req); __complete_request(req);
} }
if (m.flags & CEPH_OSD_FLAG_ONDISK)
complete_all(&req->r_safe_completion);
ceph_osdc_put_request(req);
} else { } else {
if (req->r_unsafe_callback) { if (req->r_unsafe_callback) {
dout("req %p tid %llu unsafe-cb\n", req, req->r_tid); dout("req %p tid %llu unsafe-cb\n", req, req->r_tid);
...@@ -2900,10 +2903,7 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg) ...@@ -2900,10 +2903,7 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg)
WARN_ON(1); WARN_ON(1);
} }
} }
if (m.flags & CEPH_OSD_FLAG_ONDISK)
complete_all(&req->r_safe_completion);
ceph_osdc_put_request(req);
return; return;
fail_request: fail_request:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment