]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: return -EINVAL if op is for existing cache tier
authormyoungwon oh <ohmyoungwon@gmail.com>
Wed, 24 Feb 2021 14:39:50 +0000 (23:39 +0900)
committerSage Weil <sage@newdream.net>
Sun, 21 Mar 2021 13:23:04 +0000 (08:23 -0500)
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 <myoungwon.oh@samsumg.com>
(cherry picked from commit 61b43e93bbb636c4852a304da031497a4c3671e3)

src/osd/PrimaryLogPG.cc

index e639ca299b9ae9841291386e169d77c8d1370b3b..4a17591cf194cb5aea82fccf0e39e98564ea18c0 100644 (file)
@@ -6050,7 +6050,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& 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<OSDOp>& 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<OSDOp>& 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;
        }