From: Yuan Zhou Date: Mon, 25 Feb 2019 03:31:46 +0000 (+0800) Subject: tools: return real cache status on lookup in immutable obj cache X-Git-Tag: v15.0.0~136^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88bc6ca0f2c4a723000aec325e852073c7cd5808;p=ceph.git tools: return real cache status on lookup in immutable obj cache Signed-off-by: Yuan Zhou --- diff --git a/src/tools/immutable_object_cache/CacheController.cc b/src/tools/immutable_object_cache/CacheController.cc index dd4ef3f3ed1..213b2d36b50 100644 --- a/src/tools/immutable_object_cache/CacheController.cc +++ b/src/tools/immutable_object_cache/CacheController.cc @@ -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; diff --git a/src/tools/immutable_object_cache/ObjectCacheStore.cc b/src/tools/immutable_object_cache/ObjectCacheStore.cc index b1a4b37291b..cafe4a731e8 100644 --- a/src/tools/immutable_object_cache/ObjectCacheStore.cc +++ b/src/tools/immutable_object_cache/ObjectCacheStore.cc @@ -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);