After removing the last snapshot linked to a parent image,
don't clear the CLONE_CHILD op feature bit if the image HEAD
is still linked to the parent.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
return r;
}
+ cls_rbd_parent parent;
+ r = read_key(hctx, "parent", &parent);
+ if (r < 0 && r != -ENOENT) {
+ return r;
+ }
+ bool has_parent = (r >= 0 && parent.pool != -1);
+
uint64_t op_features_mask = 0ULL;
- if (!has_child_snaps) {
+ if (!has_child_snaps && !has_parent) {
// disable clone child op feature if no longer associated
op_features_mask |= RBD_OPERATION_FEATURE_CLONE_CHILD;
}