]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: return real cache status on lookup in immutable obj cache
authorYuan Zhou <yuan.zhou@intel.com>
Mon, 25 Feb 2019 03:31:46 +0000 (11:31 +0800)
committerYuan Zhou <yuan.zhou@intel.com>
Thu, 21 Mar 2019 16:16:30 +0000 (00:16 +0800)
Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
src/tools/immutable_object_cache/CacheController.cc
src/tools/immutable_object_cache/ObjectCacheStore.cc

index dd4ef3f3ed1359dfceba17fda517d9739cf1b314..213b2d36b50078ecd04af330fc14818c8af34a67 100644 (file)
@@ -103,7 +103,7 @@ void CacheController::handle_request(uint64_t session_id, ObjectCacheRequest* re
                                                     data->m_snap_id,
                                                     data->m_oid,
                                                     cache_path);
-      if (ret < 0) {
+      if (ret != OBJ_CACHE_PROMOTED) {
         ObjectCacheReadRadosData reply_data;
         reply_data.type = RBDSC_READ_RADOS;
         reply_data.seq = req->seq;
index b1a4b37291b9b055c277ab165d3c7a268c05f06c..cafe4a731e8a8a3afa7b8a654dcee12e3f4fdd57 100644 (file)
@@ -192,14 +192,13 @@ int ObjectCacheStore::lookup_object(std::string pool_nspace,
       if (pret < 0) {
         lderr(m_cct) << "fail to start promote" << dendl;
       }
-      return pret;
+      return ret;
     }
     case OBJ_CACHE_PROMOTED:
-      target_cache_file_path = std::move(
-        get_cache_file_path(cache_file_name));
-      return 0;
+      target_cache_file_path = get_cache_file_path(cache_file_name);
+      return ret;
     case OBJ_CACHE_SKIP:
-      return pret;
+      return ret;
     default:
       lderr(m_cct) << "unrecognized object cache status" << dendl;
       ceph_assert(0);