]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/buffer: correct list_iterator::operator!= behavior
authorJason Dillaman <dillaman@redhat.com>
Wed, 10 Feb 2016 18:25:03 +0000 (13:25 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 3 Mar 2016 21:43:40 +0000 (16:43 -0500)
It was actually behaving as if it were operator==.  This results
in loops running off the end of empty bufferlists.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/common/buffer.cc

index ae1ffbe4b3f3d97675a561120da6fd4fcc854c7f..eb43810a3250333105e0e72dc34bd23f39087f0e 100644 (file)
@@ -1085,7 +1085,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
   template<bool is_const>
   bool buffer::list::iterator_impl<is_const>::operator!=(const buffer::list::iterator_impl<is_const>& rhs) const
   {
-    return bl == rhs.bl && off == rhs.off;
+    return bl != rhs.bl || off != rhs.off;
   }
 
   template<bool is_const>