From: Mykola Golub Date: Sat, 18 Aug 2018 16:24:55 +0000 (+0300) Subject: librbd: potential race on image create request complete X-Git-Tag: v13.2.2~57^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23858%2Fhead;p=ceph.git librbd: potential race on image create request complete Fixes: http://tracker.ceph.com/issues/24910 Signed-off-by: Mykola Golub (cherry picked from commit d9e5cfaf4a8cd090362892805e837f777b220474) --- diff --git a/src/librbd/image/CreateRequest.cc b/src/librbd/image/CreateRequest.cc index 935780aa194..638360ae9ff 100644 --- a/src/librbd/image/CreateRequest.cc +++ b/src/librbd/image/CreateRequest.cc @@ -768,8 +768,9 @@ void CreateRequest::complete(int r) { } m_data_io_ctx.close(); - m_on_finish->complete(r); + auto on_finish = m_on_finish; delete this; + on_finish->complete(r); } // cleanup