]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: fix subvolume creation with quota 28384/head
authorRamana Raja <rraja@redhat.com>
Mon, 3 Jun 2019 09:46:18 +0000 (15:16 +0530)
committerRamana Raja <rraja@redhat.com>
Tue, 4 Jun 2019 17:04:35 +0000 (22:34 +0530)
A quota is set on a subvolume by setting a quota virtual
xattr on a fs subdirectory. The value of the quota xattr
should be a bytes object. The quota value wasn't correctly
converted to a bytes object. Fix this.

Fixes: http://tracker.ceph.com/issues/40152
Signed-off-by: Ramana Raja <rraja@redhat.com>
src/pybind/mgr/volumes/fs/subvolume.py

index 40327e5c5a5453977c932f4642fee83389a2f03e..b1ec7b3f8500220273d9c02ec55a45718c928e6d 100644 (file)
@@ -159,7 +159,7 @@ class SubvolumeClient(object):
         self._mkdir_p(path, mode)
 
         if size is not None:
-            self.fs.setxattr(path, 'ceph.quota.max_bytes', size.encode('utf-8'), 0)
+            self.fs.setxattr(path, 'ceph.quota.max_bytes', str(size).encode('utf-8'), 0)
 
         # enforce security isolation, use separate namespace for this subvolume
         if namespace_isolated: