]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados_bench: wait for completion callbacks before returning
authorMike Ryan <mike.ryan@inktank.com>
Tue, 28 Aug 2012 18:57:03 +0000 (11:57 -0700)
committerMike Ryan <mike.ryan@inktank.com>
Tue, 28 Aug 2012 21:21:13 +0000 (14:21 -0700)
If we don't wait for the callback, the finisher may cleanup the callback
context before the callback is actually invoked, causing a
use-after-free error.

This fixes #3048.

Signed-off-by: Mike Ryan <mike.ryan@inktank.com>
src/rados.cc

index 8f8489a526686e5c00c8aa7d4e20c51adee9e35b..50131e32f94c9fff0916bfba06d9e958d6d9b6ce 100644 (file)
@@ -807,7 +807,7 @@ protected:
   }
 
   int completion_wait(int slot) {
-    return completions[slot]->wait_for_safe();
+    return completions[slot]->wait_for_safe_and_cb();
   }
   int completion_ret(int slot) {
     return completions[slot]->get_return_value();