]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: allow pool names with '-' and '.' 35063/head
authorRamana Raja <rraja@redhat.com>
Thu, 14 May 2020 10:06:22 +0000 (15:36 +0530)
committerRamana Raja <rraja@redhat.com>
Tue, 19 May 2020 08:04:49 +0000 (13:34 +0530)
... to be set as pool layouts for files and directories.

Fixes: https://tracker.ceph.com/issues/45521
Signed-off-by: Ramana Raja <rraja@redhat.com>
doc/cephfs/administration.rst
doc/cephfs/createfs.rst
doc/cephfs/file-layouts.rst
qa/tasks/cephfs/test_admin.py
src/mds/mdstypes.h

index 74e73b698e125fe8339df73fd8c2e1bfda6ad601..605864431c270d779afa48eeb0b6bc0d403ad004 100644 (file)
@@ -6,6 +6,9 @@ CephFS Administrative commands
 File Systems
 ------------
 
+.. note:: The names of the file systems, metadata pools, and data pools can
+          only have characters in the set [a-zA-Z0-9\_-.].
+
 These commands operate on the CephFS file systems in your Ceph cluster.
 Note that by default only one file system is permitted: to enable
 creation of multiple file systems use ``ceph fs flag set enable_multiple true``.
index b5246d8eb33d0b149dab38258da48df5f6440cf6..7c0e35cf63d215bad0172b3739c888399ec08e76 100644 (file)
@@ -35,6 +35,8 @@ Generally, the metadata pool will have at most a few gigabytes of data. For
 this reason, a smaller PG count is usually recommended. 64 or 128 is commonly
 used in practice for large clusters.
 
+.. note:: The names of the file systems, metadata pools, and data pools can
+          only have characters in the set [a-zA-Z0-9\_-.].
 
 Creating a file system
 ======================
index b779b16d207ab2f3a988b1c08dd96c41aacf0725..6ff834b083f49bb60b4e88609afd7832f9ac83f7 100644 (file)
@@ -20,10 +20,10 @@ Layout fields
 -------------
 
 pool
-    String, giving ID or name.  Which RADOS pool a file's data objects will be stored in.
+    String, giving ID or name. String can only have characters in the set [a-zA-Z0-9\_-.]. Which RADOS pool a file's data objects will be stored in.
 
 pool_namespace
-    String.  Within the data pool, which RADOS namespace the objects will
+    String with only characters in the set [a-zA-Z0-9\_-.].  Within the data pool, which RADOS namespace the objects will
     be written to.  Empty by default (i.e. default namespace).
 
 stripe_unit
index 140e5de15f6b669455d8f65ca35b2166515f40f2..7ff6ed536b9ab4c95290d48319cc0e2e2c3f9c8f 100644 (file)
@@ -74,6 +74,14 @@ class TestAdminCommands(CephFSTestCase):
         self.mount_a.run_shell("mkdir subdir")
         self.fs.set_dir_layout(self.mount_a, "subdir", FileLayout(pool=p))
 
+    def test_add_data_pool_non_alphamueric_name_as_subdir(self):
+        """
+        That a new data pool with non-alphanumeric name can be added and used for a sub-directory.
+        """
+        p = self.fs.add_data_pool("I-am-data_pool00.")
+        self.mount_a.run_shell("mkdir subdir")
+        self.fs.set_dir_layout(self.mount_a, "subdir", FileLayout(pool=p))
+
     def test_add_data_pool_ec(self):
         """
         That a new EC data pool can be added.
index 3f46860e78b562ad00dc19f8d957d51c5ef5a782..403132f0a30aac0c293df16033d9ded152b30d7d 100644 (file)
@@ -1856,7 +1856,7 @@ struct keys_and_values
       query =  pair >> *(qi::lit(' ') >> pair);
       pair  =  key >> '=' >> value;
       key   =  qi::char_("a-zA-Z_") >> *qi::char_("a-zA-Z_0-9");
-      value = +qi::char_("a-zA-Z_0-9");
+      value = +qi::char_("a-zA-Z0-9-_.");
     }
   qi::rule<Iterator, std::map<std::string, std::string>()> query;
   qi::rule<Iterator, std::pair<std::string, std::string>()> pair;