From ce166c2cd706b8573deabd331d29544e75e85972 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Fri, 15 Jul 2016 11:32:18 +0800 Subject: [PATCH] ObjectCacher: fix last_write check in bh_write_adjacencies() Make the last_write check in bh_write_adjacencies() match corresponding check in flush(). Fixes: http://tracker.ceph.com/issues/16610 Signed-off-by: Yan, Zheng --- src/osdc/ObjectCacher.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 90c8329a826e4..878e390c0ef54 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -888,7 +888,7 @@ void ObjectCacher::bh_write_adjacencies(BufferHead *bh, ceph::real_time cutoff, BufferHead *obh = *p; if (obh->ob != bh->ob) break; - if (obh->is_dirty() && obh->last_write < cutoff) { + if (obh->is_dirty() && obh->last_write <= cutoff) { blist.push_back(obh); ++count; total_len += obh->length(); @@ -903,7 +903,7 @@ void ObjectCacher::bh_write_adjacencies(BufferHead *bh, ceph::real_time cutoff, BufferHead *obh = *it; if (obh->ob != bh->ob) break; - if (obh->is_dirty() && obh->last_write < cutoff) { + if (obh->is_dirty() && obh->last_write <= cutoff) { blist.push_front(obh); ++count; total_len += obh->length(); @@ -1778,7 +1778,7 @@ void ObjectCacher::flusher_entry() int max = MAX_FLUSH_UNDER_LOCK; while ((bh = static_cast(bh_lru_dirty. lru_get_next_expire())) != 0 && - bh->last_write < cutoff && + bh->last_write <= cutoff && max > 0) { ldout(cct, 10) << "flusher flushing aged dirty bh " << *bh << dendl; if (scattered_write) {