From 52fa4f2436470f32248659456311abe9ed4f15a1 Mon Sep 17 00:00:00 2001 From: Ramana Raja Date: Mon, 3 Jun 2019 15:16:18 +0530 Subject: [PATCH] mgr/volumes: fix subvolume creation with quota 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 (cherry picked from commit 695c9e4dc83e77d13e9fad057d77994594fdd226) --- src/pybind/mgr/volumes/fs/subvolume.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/volumes/fs/subvolume.py b/src/pybind/mgr/volumes/fs/subvolume.py index 40122dcf43f13..9e476c7a7c86b 100644 --- a/src/pybind/mgr/volumes/fs/subvolume.py +++ b/src/pybind/mgr/volumes/fs/subvolume.py @@ -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: -- 2.39.5