diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index e681ed8e6..d35b366cd 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -1848,7 +1848,8 @@ void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans, int reset) if (retain_orphans) { struct format_type *fmt; - lvmcache_init(cmd); + if (!lvmcache_init(cmd)) + stack; dm_list_iterate_items(fmt, &cmd->formats) { if (!lvmcache_add_orphan_vginfo(fmt->orphan_vg_name, fmt)) diff --git a/lib/device/bcache.c b/lib/device/bcache.c index 0183079b4..62970efd4 100644 --- a/lib/device/bcache.c +++ b/lib/device/bcache.c @@ -1004,7 +1004,8 @@ void bcache_destroy(struct bcache *cache) if (cache->nr_locked) log_warn("some blocks are still locked"); - bcache_flush(cache); + if (!bcache_flush(cache)) + stack; _wait_all(cache); _exit_free_list(cache); radix_tree_destroy(cache->rtree);