]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: make pool snaps on cache tier should be not allowed
authorMingxin Liu <mingxin@xsky.com>
Thu, 26 May 2016 10:53:34 +0000 (18:53 +0800)
committerMingxin Liu <mingxin@xsky.com>
Sat, 21 Jan 2017 17:26:34 +0000 (01:26 +0800)
Signed-off-by: Mingxin Liu <mingxin@xsky.com>
src/mon/OSDMonitor.cc

index 6194c5ba332030b622ed16603a670a81d123cd87..0409779ddc09c24970c139fd08317685ec8be65e 100644 (file)
@@ -6969,6 +6969,10 @@ done:
       ss << "pool " << poolstr << " snap " << snapname << " already exists";
       err = 0;
       goto reply;
+    } else if (p->is_tier()) {
+      ss << "pool " << poolstr << " is a cache tier";
+      err = -EINVAL;
+      goto reply;
     }
     pg_pool_t *pp = 0;
     if (pending_inc.new_pools.count(pool))
@@ -7875,7 +7879,7 @@ bool OSDMonitor::preprocess_pool_op(MonOpRequestRef op)
 
   switch (m->op) {
   case POOL_OP_CREATE_SNAP:
-    if (p->is_unmanaged_snaps_mode()) {
+    if (p->is_unmanaged_snaps_mode() || p->is_tier()) {
       _pool_op_reply(op, -EINVAL, osdmap.get_epoch());
       return true;
     }
@@ -7975,6 +7979,11 @@ bool OSDMonitor::prepare_pool_op(MonOpRequestRef op)
 
   switch (m->op) {
     case POOL_OP_CREATE_SNAP:
+      if (pool->is_tier()) {
+        ret = -EINVAL;
+        _pool_op_reply(op, ret, osdmap.get_epoch());
+        return false;
+      }  // else, fall through
     case POOL_OP_DELETE_SNAP:
       if (!pool->is_unmanaged_snaps_mode()) {
         bool snap_exists = pool->snap_exists(m->name.c_str());