From: Sage Weil Date: Mon, 1 Feb 2016 18:01:32 +0000 (-0500) Subject: mon/MDSMonitor: prevent pool 0 from being used as a data pool X-Git-Tag: v10.1.0~241^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9c7669b95ad7468376e8618f1c508bfbba3fe061;p=ceph.git mon/MDSMonitor: prevent pool 0 from being used as a data pool 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 --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 4477f3c6529f..9eeb2a2c58f2 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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);