From: Nikhilkumar Shelke Date: Sun, 12 Jun 2022 11:33:16 +0000 (+0530) Subject: mgr/volumes: remove incorrect 'size' from output of 'snapshot info' X-Git-Tag: v18.0.0~665^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f514a0bd14b30f6ef6a77541f4cf75541b52322;p=ceph.git 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 --- 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 8c98b373622..f3a850b5d58 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: