]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: touch hit bh although there are missing or rx bh.
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 29 Jan 2015 08:41:49 +0000 (16:41 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Fri, 30 Jan 2015 03:44:11 +0000 (11:44 +0800)
Avoid losing the hit bh when later read, it should touch hit bh like rx bh.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/osdc/ObjectCacher.cc

index 95a4bda13e29dd3af85360b7cd791789dd798a16..fff85e5c811ac4d0992431aff4d76d8d7b74b213 100644 (file)
@@ -1157,7 +1157,12 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish,
         }
         bytes_not_in_cache += bh_it->second->length();
        success = false;
-      }      
+      }
+
+      for (map<loff_t, BufferHead*>::iterator bh_it = hits.begin();
+           bh_it != hits.end();  ++bh_it)
+       touch_bh(bh_it->second); //bump in lru, so we don't lose it when later read
+
     } else {
       assert(!hits.empty());