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 <ilya.dryomov@inktank.com>
(cherry picked from commit
4ebc32f37a4860bdc676491bf8b042c18fd619cf)
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);