Project

General

Profile

Bug #18325

Removing a clone that fails to open its parent might leave dangling rbd_children reference

Added by Jason Dillaman over 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
kraken,jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Create a parent image in pool X, and a clone in pool Y. Using a user that doesn't have any permission to pool X, remove the clone image:

        # rbd --id test -p rbd rm destination
        2016-12-21 11:50:03.758221 7f32b7459700 -1 librbd::image::OpenRequest: failed to retreive name: (1) Operation not permitted
        2016-12-21 11:50:03.758288 7f32b6c58700 -1 librbd::image::RefreshParentRequest: failed to open parent image: (1) Operation not permitted
        2016-12-21 11:50:03.758312 7f32b6c58700 -1 librbd::image::RefreshRequest: failed to refresh parent image: (1) Operation not permitted
        2016-12-21 11:50:03.758333 7f32b6c58700 -1 librbd::image::OpenRequest: failed to refresh image: (1) Operation not permitted
        2016-12-21 11:50:03.759366 7f32b6c58700 -1 librbd::ImageState: failed to open image: (1) Operation not permitted
        Removing image: 100% complete...done.

Now the clone image has been removed, but the parent image cannot be deleted because there is a dangling reference to the deleted clone image.


Related issues

Copied to rbd - Backport #18608: jewel: Removing a clone that fails to open its parent might leave dangling rbd_children reference Resolved
Copied to rbd - Backport #18609: kraken: Removing a clone that fails to open its parent might leave dangling rbd_children reference Resolved

History

#1 Updated by Ricardo Dias about 7 years ago

What should be the correct behavior for these cases, forbid the user from removing a clone when it does not have permissions to change the parent image properties?

#2 Updated by Jason Dillaman about 7 years ago

Couple things:

(1) if the parent image fails to be opened, we still want to ensure the child image is "opened" so that it can properly clean up. Right now failing to open the parent will cause the remove logic to assume the child image has already been deleted so it just removes the image from the directory. In the remove case, we could pass a special op to OpenRequest to say "don't attempt to open the parent".

(2) even if the parent fails to open, if we have a parent spec, we should ensure we update rbd_children to remove our reference.

#3 Updated by Ricardo Dias about 7 years ago

  • Status changed from New to In Progress
  • Assignee set to Ricardo Dias

#5 Updated by Jason Dillaman about 7 years ago

  • Status changed from In Progress to Pending Backport

#7 Updated by Nathan Cutler about 7 years ago

  • Copied to Backport #18608: jewel: Removing a clone that fails to open its parent might leave dangling rbd_children reference added

#8 Updated by Nathan Cutler about 7 years ago

  • Copied to Backport #18609: kraken: Removing a clone that fails to open its parent might leave dangling rbd_children reference added

#10 Updated by Nathan Cutler about 7 years ago

  • Backport changed from kraken,jewel,hammer to kraken,jewel

#11 Updated by Nathan Cutler almost 7 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF