]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ObjectCacher: fix last_write check in bh_write_adjacencies() 10304/head
authorYan, Zheng <zyan@redhat.com>
Fri, 15 Jul 2016 03:32:18 +0000 (11:32 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 15 Jul 2016 03:39:01 +0000 (11:39 +0800)
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 <zyan@redhat.com>
src/osdc/ObjectCacher.cc

index 90c8329a826e4ff26eda4eeace3001b0bd8c3fbd..878e390c0ef543498d2f0df9e16df1fafec00dc5 100644 (file)
@@ -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<BufferHead*>(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) {