]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: allow pool names with '-' and '.' 35251/head
authorRamana Raja <rraja@redhat.com>
Thu, 14 May 2020 10:06:22 +0000 (15:36 +0530)
committerNathan Cutler <ncutler@suse.com>
Tue, 26 May 2020 19:42:55 +0000 (21:42 +0200)
... 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>
(cherry picked from commit d9f8f8e3d073de8e1cfd5075159420ca8dfdcf2d)

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 11c54a1cd3c13f8b596255fa00cefb86286e6431..241ba3dc92785de4000277ef2f21255d888b93e1 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 c535489602a101e6403e919e312c77c1e0d86d32..4eb0e18bd0d362f14e882cf6c22b8b52e5900c44 100644 (file)
@@ -67,6 +67,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 ddaed5666d609c9089e4d3b4ce30bb475fd03387..9d93f5b0ba13a2c0555c77d71b17ae569caa62d0 100644 (file)
@@ -1782,7 +1782,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<string, string>()> query;
     qi::rule<Iterator, std::pair<string, string>()> pair;