diff --git a/lib/activate/activate.c b/lib/activate/activate.c index b898df656..311cbb4a6 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -2461,7 +2461,6 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, const struct logi const struct lv_activate_opts laopts = { .skip_in_use = 1 }; struct dm_list *snh; int r = 0; - unsigned tmp_state; if (!activation()) return 1; @@ -2534,9 +2533,6 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, const struct logi } critical_section_dec(cmd, "deactivated"); - tmp_state = cmd->disable_dm_devs; - cmd->disable_dm_devs = 1; - if (!lv_info(cmd, lv, 0, &info, 0, 0) || info.exists) { /* Turn into log_error, but we do not log error */ log_debug_activation("Deactivated volume is still %s present.", @@ -2544,7 +2540,6 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s, const struct logi r = 0; } - cmd->disable_dm_devs = tmp_state; out: return r; diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index f4e47b531..a7a2e98ae 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -1062,8 +1062,7 @@ int dev_manager_info(struct cmd_context *cmd, if (!(dlid = build_dm_uuid(cmd->mem, lv, layer))) goto_out; - if (!cmd->disable_dm_devs && - cmd->cache_dm_devs && + if (cmd->cache_dm_devs && !dm_device_list_find_by_uuid(cmd->cache_dm_devs, dlid, NULL)) { log_debug("Cached as inactive %s.", name); if (dminfo) @@ -2436,8 +2435,7 @@ static int _add_dev_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, if (!(dlid = build_dm_uuid(dm->track_pending_delete ? dm->cmd->pending_delete_mem : dm->mem, lv, layer))) return_0; - if (!dm->cmd->disable_dm_devs && - dm->cmd->cache_dm_devs) { + if (dm->cmd->cache_dm_devs) { if (!dm_device_list_find_by_uuid(dm->cmd->cache_dm_devs, dlid, &dev)) { log_debug("Cached as not present %s.", name); return 1; diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h index 043afbf76..8c1d81d6d 100644 --- a/lib/commands/toolcontext.h +++ b/lib/commands/toolcontext.h @@ -211,7 +211,6 @@ struct cmd_context { unsigned event_activation:1; /* whether event_activation is set */ unsigned udevoutput:1; unsigned online_vg_file_removed:1; - unsigned disable_dm_devs:1; /* temporarily disable use of dm devs cache */ unsigned filter_regex_set_preferred_name_disable:1; /* prevent dev_set_preferred_name */ unsigned device_ids_check_product_uuid:1; unsigned device_ids_check_hostname:1;