Project

General

Profile

Bug #18325

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

Added by Jason Dillaman 4 months ago. Updated 11 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
12/21/2016
Due date:
% Done:

0%

Source:
Tags:
Backport:
kraken,jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Release:
Needs Doc:
No

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 Backport #18608: jewel: Removing a clone that fails to open its parent might leave dangling rbd_children reference Resolved
Copied to 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 4 months 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 4 months 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 4 months ago

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

#5 Updated by Jason Dillaman 3 months ago

  • Status changed from In Progress to Pending Backport

#7 Updated by Nathan Cutler 3 months 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 3 months 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 3 months ago

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

#11 Updated by Nathan Cutler 11 days ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF