From 9f514a0bd14b30f6ef6a77541f4cf75541b52322 Mon Sep 17 00:00:00 2001 From: Nikhilkumar Shelke Date: Sun, 12 Jun 2022 17:03:16 +0530 Subject: [PATCH] mgr/volumes: remove incorrect 'size' from output of 'snapshot info' The 'size' shown in the output of snapshot info command relies on rstats which is incorrect snapshot size. It tracks size of the subvolume from the snapshot has been taken instead of the snapshot itself. Hence having the 'size' field in the output of 'snapshot info' doesn't make sense until the rstats is fixed. Fixes: https://tracker.ceph.com/issues/55822 Signed-off-by: Nikhilkumar Shelke --- .../mgr/volumes/fs/operations/versions/subvolume_v1.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py index 8c98b3736222f..f3a850b5d58e8 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py @@ -753,12 +753,11 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate): snappath = self.snapshot_data_path(snapname) snap_info = {} try: - snap_attrs = {'created_at':'ceph.snap.btime', 'size':'ceph.dir.rbytes', + snap_attrs = {'created_at':'ceph.snap.btime', 'data_pool':'ceph.dir.layout.pool'} for key, val in snap_attrs.items(): snap_info[key] = self.fs.getxattr(snappath, val) - return {'size': int(snap_info['size']), - 'created_at': str(datetime.fromtimestamp(float(snap_info['created_at']))), + return {'created_at': str(datetime.fromtimestamp(float(snap_info['created_at']))), 'data_pool': snap_info['data_pool'].decode('utf-8'), 'has_pending_clones': "yes" if self.has_pending_clones(snapname) else "no"} except cephfs.Error as e: -- 2.39.5