From: Ilya Dryomov Date: Wed, 29 Jan 2014 14:12:01 +0000 (+0200) Subject: rbd: don't forget to call close_image() if remove_child() fails X-Git-Tag: v0.67.10~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61e2219dd07ebb856a61f54e8cd992dc1e16f5d9;p=ceph.git rbd: don't forget to call close_image() if remove_child() fails close_image() among other things unregisters a watcher that's been registered by open_image(). Even though it'll timeout in 30 or so seconds, it's not nice now that we check for watchers before starting the removal process. Signed-off-by: Ilya Dryomov (cherry picked from commit 4ebc32f37a4860bdc676491bf8b042c18fd619cf) --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index a32ce946229..68a9e571d2b 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -1385,6 +1385,7 @@ reprotect_and_return_err: parent_info.spec, id); if (r < 0 && r != -ENOENT) { lderr(cct) << "error removing child from children list" << dendl; + close_image(ictx); return r; } close_image(ictx);