Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librbd: prevent racing clone and snap unprotect
If the following sequence of events occured, a clone could be created of an unprotected snapshot: 1. A: begin clone - check that snap foo is protected 2. B: rbd unprotect snap foo 3. B: check that all pools have no clones of foo 4. B: unprotect snap foo 5. A: finish creating clone of foo, add it as a child To stop this from happening, check at the beginning and end of cloning that the parent snapshot is protected. If it is not, or checking protection status fails (possibly because the parent snapshot was removed), remove the clone and return an error. Signed-off-by: Josh Durgin <[email protected]>
- Loading branch information