]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
prio-q: initialize cur iterator
authorNoah Watkins <noahwatkins@gmail.com>
Wed, 30 Oct 2013 23:34:29 +0000 (16:34 -0700)
committerSage Weil <sage@inktank.com>
Fri, 1 Nov 2013 23:02:15 +0000 (16:02 -0700)
For new SubQueues `cur` is not intialized, so front/pop_front will freak
out. I honestly I have no idea how this hasn't been seen, but it was
being triggered frequently on OSX.

Fixes: #6686
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
src/common/PrioritizedQueue.h

index 6dcb519da400e4d81f59fceb93098f68d908dda5..e663f277693ea51a28cf3d5f6c5d32262bc8ebf6 100644 (file)
@@ -92,7 +92,7 @@ class PrioritizedQueue {
     SubQueue()
       : tokens(0),
        max_tokens(0),
-       size(0) {}
+       size(0), cur(q.begin()) {}
     void set_max_tokens(unsigned mt) {
       max_tokens = mt;
     }