]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: remove incorrect 'size' from output of 'snapshot info'
authorNikhilkumar Shelke <nshelke@redhat.com>
Sun, 12 Jun 2022 11:33:16 +0000 (17:03 +0530)
committerNikhilkumar Shelke <nshelke@redhat.com>
Sun, 12 Jun 2022 11:46:29 +0000 (17:16 +0530)
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 <nshelke@redhat.com>
src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py

index 8c98b3736222faf3e2681b8aafbf701383764887..f3a850b5d58e8798c85089aae3a2036bdb02d00c 100644 (file)
@@ -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: