]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: prevent pool 0 from being used as a data pool
authorSage Weil <sage@redhat.com>
Mon, 1 Feb 2016 18:01:32 +0000 (13:01 -0500)
committerSage Weil <sage@redhat.com>
Tue, 1 Mar 2016 16:18:17 +0000 (11:18 -0500)
Pool 0 means no change or default in the legacy ceph_file_layout in the
layout ioctl and file create arguments. Prevent it from being used to avoid
putting users in an awkward situation later.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MDSMonitor.cc

index 4477f3c6529f09a4689251ad81f992e8536adc9a..9eeb2a2c58f265599eb9cf8fa18fb565efc38d77 100644 (file)
@@ -1276,6 +1276,10 @@ int MDSMonitor::management_command(
       ss << "pool '" << data_name << "' does not exist";
       return -ENOENT;
     }
+    if (data == 0) {
+      ss << "pool '" << data_name << "' has id 0, which CephFS does not allow. Use another pool or recreate it to get a non-zero pool id.";
+      return -EINVAL;
+    }
    
     string fs_name;
     cmd_getval(g_ceph_context, cmdmap, "fs_name", fs_name);