mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dev_manager: drop cache for dm tree manipulation
We've got cached DM list before grabbing lock, so there is some chance, that DM table has changed and we would need to refresh this info. TODO: benchmark, whether it would even make sense to refresh cache and keep it content instead of using individual ioctl() for tree build.
This commit is contained in:
parent
d192477ae6
commit
e211768d1c
@ -3945,7 +3945,6 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
|
||||
struct dm_tree_node *root;
|
||||
char *dlid;
|
||||
int r = 0;
|
||||
unsigned tmp_state;
|
||||
|
||||
if (action < DM_ARRAY_SIZE(_action_names))
|
||||
log_debug_activation("Creating %s%s tree for %s.",
|
||||
@ -3964,14 +3963,11 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
|
||||
dm->activation = ((action == PRELOAD) || (action == ACTIVATE));
|
||||
dm->suspend = (action == SUSPEND_WITH_LOCKFS) || (action == SUSPEND);
|
||||
|
||||
/* ATM do not use caching for anything else then striped target.
|
||||
* And also skip for CLEAN action */
|
||||
tmp_state = dm->cmd->disable_dm_devs;
|
||||
if (!seg_is_striped_target(first_seg(lv)) || (action == CLEAN))
|
||||
dm->cmd->disable_dm_devs = 1;
|
||||
/* Drop any cache before DM table manipulation within locked section
|
||||
* TODO: check if it makes sense to manage cache within lock */
|
||||
dm_device_list_destroy(&dm->cmd->cache_dm_devs);
|
||||
|
||||
dtree = _create_partial_dtree(dm, lv, laopts->origin_only);
|
||||
dm->cmd->disable_dm_devs = tmp_state;
|
||||
|
||||
if (!dtree)
|
||||
return_0;
|
||||
|
Loading…
Reference in New Issue
Block a user