提交 6001567c 编写于 作者: I Ilya Dryomov

libceph: avoid a use-after-free during map check

Sending map check after complete_request() was called is not only
useless, but can lead to a use-after-free as req->r_kref decrement in
__complete_request() races with map check code.
Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
Acked-by: NJeff Layton <jlayton@redhat.com>
Reviewed-by: N"Yan, Zheng" <zyan@redhat.com>
上级 29e87820
......@@ -2266,7 +2266,7 @@ static void __submit_request(struct ceph_osd_request *req, bool wrlocked)
complete_request(req, err);
mutex_unlock(&osd->lock);
if (ct_res == CALC_TARGET_POOL_DNE)
if (!err && ct_res == CALC_TARGET_POOL_DNE)
send_map_check(req);
if (promoted)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册