From: Yan, Zheng Date: Fri, 15 Jul 2016 03:32:18 +0000 (+0800) Subject: ObjectCacher: fix last_write check in bh_write_adjacencies() X-Git-Tag: ses5-milestone5~307^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ce166c2cd706b8573deabd331d29544e75e85972;p=ceph.git 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 --- diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 90c8329a826e..878e390c0ef5 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) {