]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: fix subvolume creation with quota
authorRamana Raja <rraja@redhat.com>
Mon, 3 Jun 2019 09:46:18 +0000 (15:16 +0530)
committerRamana Raja <rraja@redhat.com>
Thu, 6 Jun 2019 15:32:58 +0000 (21:02 +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>
(cherry picked from commit 695c9e4dc83e77d13e9fad057d77994594fdd226)

src/pybind/mgr/volumes/fs/subvolume.py

index 40122dcf43f13df970e27e2dd379492c8c2d93d9..9e476c7a7c86b49c3bab0d3fdbc8917fcf16f127 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: