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: v17.1.0~2640^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61b43e93bbb636c4852a304da031497a4c3671e3;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 --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2fa3c40f91f..d649eb99aa4 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6046,7 +6046,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; } @@ -6079,7 +6079,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; } @@ -6116,7 +6116,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; }