Skip to content

Commit 79967fb

Browse files
authored
Merge pull request ceph#57151 from rhcs-dashboard/fix-65698-main
mgr/dashboard: exclude cloned-deleted RBD snaps Reviewed-by: Ilya Dryomov <[email protected]> Reviewed-by: Nizamudeen A <[email protected]>
2 parents 540c4dc + 8b1ef2e commit 79967fb

File tree

1 file changed

+5
-1
lines changed
  • src/pybind/mgr/dashboard/services

1 file changed

+5
-1
lines changed

src/pybind/mgr/dashboard/services/rbd.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ def _rbd_image(cls, ioctx, pool_name, namespace, image_name, # pylint: disable=
360360
# snapshots
361361
stat['snapshots'] = []
362362
for snap in img.list_snaps():
363+
# Skip trash snapshots (cloned-and-then-deleted format v2 snapshots)
364+
if snap['namespace'] == rbd.RBD_SNAP_NAMESPACE_TYPE_TRASH:
365+
continue
366+
363367
try:
364368
snap['mirror_mode'] = MIRROR_IMAGE_MODE(img.mirror_image_get_mode()).name
365369
except ValueError as ex:
@@ -369,7 +373,7 @@ def _rbd_image(cls, ioctx, pool_name, namespace, image_name, # pylint: disable=
369373
img.get_snap_timestamp(snap['id']).isoformat())
370374

371375
snap['is_protected'] = None
372-
if mirror_mode != rbd.RBD_MIRROR_IMAGE_MODE_SNAPSHOT:
376+
if snap['namespace'] == rbd.RBD_SNAP_NAMESPACE_TYPE_USER:
373377
snap['is_protected'] = img.is_protected_snap(snap['name'])
374378
snap['used_bytes'] = None
375379
snap['children'] = []

0 commit comments

Comments
 (0)