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: v12.2.9~108^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23892%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 9f43ebc6a2e6..75af7061efc0 100644 --- a/src/librbd/image/CreateRequest.cc +++ b/src/librbd/image/CreateRequest.cc @@ -763,8 +763,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