We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents af9e68e + 7d75161 commit 4aa6ff9Copy full SHA for 4aa6ff9
src/librbd/mirror/snapshot/Utils.cc
@@ -30,12 +30,15 @@ bool get_rollback_snap_id(
30
uint64_t *rollback_snap_id) {
31
32
for (; it != end; it++) {
33
- auto mirror_ns = std::get<cls::rbd::MirrorSnapshotNamespace>(
34
- it->second.snap_namespace);
35
- if (mirror_ns.state != cls::rbd::MIRROR_SNAPSHOT_STATE_NON_PRIMARY) {
+ auto mirror_ns = std::get_if<cls::rbd::MirrorSnapshotNamespace>(
+ &it->second.snap_namespace);
+ if (mirror_ns == nullptr) {
36
+ continue;
37
+ }
38
+ if (mirror_ns->state != cls::rbd::MIRROR_SNAPSHOT_STATE_NON_PRIMARY) {
39
break;
40
}
- if (mirror_ns.complete) {
41
+ if (mirror_ns->complete) {
42
43
44
0 commit comments