Signed-off-by: Jason Dillaman <dillaman@redhat.com>
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: "
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();