]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG.cc: Fixes a bug in snap_trimmer where a pointer to a stack
authorSamuel Just <samuelj@hq.newdream.net>
Thu, 9 Dec 2010 18:25:39 +0000 (10:25 -0800)
committerSamuel Just <samuelj@hq.newdream.net>
Thu, 9 Dec 2010 21:09:20 +0000 (13:09 -0800)
Cond is left in the mode.waiting_cond list.

Signed-off-by: Samuel Just <samuelj@hq.newdream.net>
src/osd/ReplicatedPG.cc

index 4405234c64b5d6ae63372ec1bd2a8ddee278e154..7e6a1e1b71c679cb8406bb2a4a45a18a83fbf019 100644 (file)
@@ -548,12 +548,15 @@ bool ReplicatedPG::snap_trimmer()
       if (!mode.try_write(nobody)) {
        dout(10) << " can't write, waiting" << dendl;
        Cond cond;
-       mode.waiting_cond.push_back(&cond);
+       list<Cond*>::iterator q = mode.waiting_cond.insert(mode.waiting_cond.end(), &cond);
        while (!mode.try_write(nobody))
          cond.Wait(_lock);
+       mode.waiting_cond.erase(q);
        dout(10) << " done waiting" << dendl;
-       if (!is_primary() || !is_active())
+       if (!(current_set_started == info.history.last_epoch_started &&
+             is_active())) {
          break;
+       }
       }
 
       // load clone info