From: Jason Dillaman Date: Thu, 27 Aug 2015 18:21:05 +0000 (-0400) Subject: librbd: possible unit test race condition X-Git-Tag: v10.0.2~193^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d6cde017aebaf2c46d2ee57f3dc3ead564baf9e;p=ceph.git librbd: possible unit test race condition It's possible during unit tests for the requests to complete prior to marking the Context as complete. In this case, the Context will fire while locks are being held. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/operation/TrimRequest.cc b/src/librbd/operation/TrimRequest.cc index d29f2018b7f..71b1546ef6d 100644 --- a/src/librbd/operation/TrimRequest.cc +++ b/src/librbd/operation/TrimRequest.cc @@ -330,7 +330,7 @@ void TrimRequest::send_clean_boundary() { extents); ContextCompletion *completion = - new ContextCompletion(create_callback_context(), true); + new ContextCompletion(create_async_callback_context(), true); for (vector::iterator p = extents.begin(); p != extents.end(); ++p) { ldout(cct, 20) << " ex " << *p << dendl;