rbd-mirror: image deleter now handles clone v2

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2018-01-29 21:12:10 -05:00
parent 01198184db
commit fb62296f6e
2 changed files with 14 additions and 1 deletions

View File

@ -117,6 +117,14 @@ void RemoveRequest<I>::remove_image() {
template <typename I>
void RemoveRequest<I>::handle_remove_image(int r) {
dout(10) << "r=" << r << dendl;
if (r == -ENOTEMPTY) {
// image must have clone v2 snapshot still associated to child
dout(10) << "snapshots still in-use" << dendl;
*m_error_result = ERROR_RESULT_RETRY_IMMEDIATELY;
finish(-EBUSY);
return;
}
if (r < 0 && r != -ENOENT) {
derr << "error removing image " << m_image_id << " "
<< "(" << m_image_id << ") from local pool: "

View File

@ -225,7 +225,12 @@ template <typename I>
void SnapshotPurgeRequest<I>::handle_snap_remove(int r) {
dout(10) << "r=" << r << dendl;
if (r < 0) {
if (r == -EBUSY) {
dout(10) << "snapshot in-use" << dendl;
m_ret_val = r;
close_image();
return;
} else if (r < 0) {
derr << "failed to remove snapshot: " << cpp_strerror(r) << dendl;
m_ret_val = r;
close_image();