From: Jason Dillaman Date: Wed, 10 Feb 2016 18:25:03 +0000 (-0500) Subject: common/buffer: correct list_iterator::operator!= behavior X-Git-Tag: v10.1.0~216^2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0e3da2ee0967f50ab731b11efaedab87db0c13f;p=ceph.git common/buffer: correct list_iterator::operator!= behavior 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 --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index ae1ffbe4b3f3..eb43810a3250 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -1085,7 +1085,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER; template bool buffer::list::iterator_impl::operator!=(const buffer::list::iterator_impl& rhs) const { - return bl == rhs.bl && off == rhs.off; + return bl != rhs.bl || off != rhs.off; } template