mirror of
https://github.com/ceph/ceph
synced 2025-01-19 17:41:39 +00:00
Merge pull request #20406 from dillaman/wip-22979
librbd: fix issues discovered in clone v2 during upgrade tests Reviewed-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
commit
ad765021bc
@ -2002,8 +2002,15 @@ int snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
|
||||
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;
|
||||
}
|
||||
|
@ -1041,8 +1041,10 @@ class TestClone(object):
|
||||
self.image.create_snap('snap2')
|
||||
global features
|
||||
clone_name2 = get_temp_image_name()
|
||||
rados.conf_set("rbd_default_clone_format", "1")
|
||||
assert_raises(InvalidArgument, self.rbd.clone, ioctx, image_name,
|
||||
'snap2', ioctx, clone_name2, features)
|
||||
rados.conf_set("rbd_default_clone_format", "auto")
|
||||
self.image.remove_snap('snap2')
|
||||
|
||||
def test_unprotect_with_children(self):
|
||||
@ -1065,8 +1067,10 @@ class TestClone(object):
|
||||
|
||||
# ...with a clone of the same parent
|
||||
other_clone_name = get_temp_image_name()
|
||||
rados.conf_set("rbd_default_clone_format", "1")
|
||||
self.rbd.clone(ioctx, image_name, 'snap1', other_ioctx,
|
||||
other_clone_name, features)
|
||||
rados.conf_set("rbd_default_clone_format", "auto")
|
||||
self.other_clone = Image(other_ioctx, other_clone_name)
|
||||
# validate its parent info
|
||||
(pool, image, snap) = self.other_clone.parent_info()
|
||||
|
Loading…
Reference in New Issue
Block a user