This patch fixes a bug in volume cloning where the source volume is
prematurely closed. If the destination volume requires flattening and
an exception occurs during flattening, the code attempts to perform
cleanup operations on an already closed volume. This resulted in a
segmentation fault which causes cinder to restart.
Co-authored-by: Jon Bernard <jobernar@redhat.com>
Change-Id: Ib713aa91b775d8ec07ffdb24dfe1db1b6ecf2921
Closes-Bug: #1794956
(cherry picked from commit 394fbd7e20)
(cherry picked from commit 7bfd3c4dcf)
(cherry picked from commit 47caae4cbb)