]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/api: set `image_snap_name` as empty string for mirror gp snap
authorRamana Raja <rraja@redhat.com>
Fri, 28 Feb 2025 21:49:27 +0000 (16:49 -0500)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:32 +0000 (21:26 +0530)
The member image snapshots of a mirror group snap do not share a
common name unlike those of a user group snap. So set the
`image_snap_name` to an empty string.

Signed-off-by: Ramana Raja <rraja@redhat.com>
src/librbd/api/Group.cc

index 69ce5776e00f4cfb896cced71c408f947fbbc4c1..466f231499fd74232d6c242d03b8dab621014fe7 100644 (file)
@@ -256,7 +256,8 @@ int GroupSnapshot_to_group_snap_info2(
   group_snap->namespace_type = static_cast<group_snap_namespace_type_t>(
     cls::rbd::get_group_snap_namespace_type(cls_group_snap.snapshot_namespace));
 
-  if (!image_snaps.empty()) {
+  if (!image_snaps.empty() &&
+      group_snap->namespace_type == RBD_GROUP_SNAP_NAMESPACE_TYPE_USER) {
     group_snap->image_snap_name = calc_ind_image_snap_name(
         group_ioctx.get_id(), group_id, cls_group_snap.id);
   }