From: myoungwon oh Date: Wed, 24 Feb 2021 14:39:50 +0000 (+0900) Subject: osd: return -EINVAL if op is for existing cache tier X-Git-Tag: v16.2.0~57^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8107b8626c7ee788f31c3ce78b5b67c270d337d0;p=ceph.git osd: return -EINVAL if op is for existing cache tier At the end of unit test, flush and evict are called. But, those ops affect manifest object because cache_mode is not set to NONE sometime. Signed-off-by: Myoungwon Oh (cherry picked from commit 61b43e93bbb636c4852a304da031497a4c3671e3) --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index e639ca299b9a..4a17591cf194 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6050,7 +6050,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) result = -EINVAL; break; } - if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE) { + if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE || obs.oi.has_manifest()) { result = -EINVAL; break; } @@ -6083,7 +6083,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) result = -EINVAL; break; } - if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE) { + if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE || obs.oi.has_manifest()) { result = -EINVAL; break; } @@ -6120,7 +6120,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) result = 0; { tracepoint(osd, do_osd_op_pre_cache_evict, soid.oid.name.c_str(), soid.snap.val); - if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE) { + if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE || obs.oi.has_manifest()) { result = -EINVAL; break; }