]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: possible unit test race condition
authorJason Dillaman <dillaman@redhat.com>
Thu, 27 Aug 2015 18:21:05 +0000 (14:21 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 19 Nov 2015 01:34:43 +0000 (20:34 -0500)
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 <dillaman@redhat.com>
src/librbd/operation/TrimRequest.cc

index d29f2018b7f525239262785c4c4643234a1bdaf8..71b1546ef6d2e3d428cfe6360ff1b18e03adab79 100644 (file)
@@ -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<ObjectExtent>::iterator p = extents.begin();
        p != extents.end(); ++p) {
     ldout(cct, 20) << " ex " << *p << dendl;