From bc66b7849aecf24c2fc1e9221fbc8c7f35d901e2 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Mon, 20 Apr 2015 13:38:10 -0400 Subject: [PATCH] librbd: always deregister child clone from parent with deep flatten Signed-off-by: Jason Dillaman --- src/librbd/AsyncFlattenRequest.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/librbd/AsyncFlattenRequest.cc b/src/librbd/AsyncFlattenRequest.cc index 2d7497737e6..f8fbde0472a 100644 --- a/src/librbd/AsyncFlattenRequest.cc +++ b/src/librbd/AsyncFlattenRequest.cc @@ -166,7 +166,8 @@ bool AsyncFlattenRequest::send_update_children() { // (if snapshots remain, they have their own parent info, and the child // will be removed when the last snap goes away) RWLock::RLocker l2(m_image_ctx.snap_lock); - if (!m_image_ctx.snaps.empty()) { + if ((m_image_ctx.features & RBD_FEATURE_DEEP_FLATTEN) == 0 && + !m_image_ctx.snaps.empty()) { return true; } @@ -180,7 +181,7 @@ bool AsyncFlattenRequest::send_update_children() { assert(r == 0); rados_completion->release(); } - } + } if (lost_exclusive_lock) { complete(-ERESTART); -- 2.47.3