]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix potential double free of SetSnapRequest instance 8803/head
authorrunsisi <runsisi@zte.com.cn>
Thu, 21 Apr 2016 06:48:55 +0000 (14:48 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 28 Apr 2016 08:27:29 +0000 (10:27 +0200)
if image feature EXCLUSIVE_LOCK is not enabled we should not try to
initialize the exclusive lock, or we may end with two async Contexts
to finish the same SetSnapRequest instance

Fixes: http://tracker.ceph.com/issues/15571
Signed-off-by: runsisi <runsisi@zte.com.cn>
(cherry picked from commit 0a6eaac12fe29762c3dd29068f9427840cfea100)

src/librbd/image/SetSnapRequest.cc

index ca10e457959e5edf9ad30aa0aced25b274027884..f30f4a97fe75a874e50d4458057896a456252269 100644 (file)
@@ -60,8 +60,8 @@ void SetSnapRequest<I>::send_init_exclusive_lock() {
     int r = 0;
     if (send_refresh_parent(&r) != nullptr) {
       send_complete();
-      return;
     }
+    return;
   }
 
   CephContext *cct = m_image_ctx.cct;