mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
cachevol: stop dm errors with uncaching cache with cachevol
Fix the anoying kernel message reported: device-mapper: cache: 253:2: metadata operation 'dm_cache_commit' failed: error = -5 which has been reported while cachevol has been removed. Happened via confusing variable - so switch the variable to commonly user '_size' which presents a value in sector units and avoid 'scaling' this as extent length by vg extent size when placing 'error' target on removal path. Patch shouldn't have impact on actual users data, since at this moment of removal all date should have been already flushed to origin device. m
This commit is contained in:
parent
25b97e522d
commit
892a182975
@ -1,5 +1,6 @@
|
|||||||
Version 2.03.09 -
|
Version 2.03.09 -
|
||||||
====================================
|
====================================
|
||||||
|
Fix showing of a dm kernel error when uncaching a volume with cachevol.
|
||||||
|
|
||||||
Version 2.03.08 - 11th February 2020
|
Version 2.03.08 - 11th February 2020
|
||||||
====================================
|
====================================
|
||||||
|
@ -3161,8 +3161,8 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
|
|||||||
char *dlid_meta;
|
char *dlid_meta;
|
||||||
char *dlid_data;
|
char *dlid_data;
|
||||||
char *dlid_pool;
|
char *dlid_pool;
|
||||||
uint64_t meta_len = first_seg(lv)->metadata_len;
|
uint64_t meta_size = first_seg(lv)->metadata_len;
|
||||||
uint64_t data_len = first_seg(lv)->data_len;
|
uint64_t data_size = first_seg(lv)->data_len;
|
||||||
uint16_t udev_flags = _get_udev_flags(dm, lv, layer,
|
uint16_t udev_flags = _get_udev_flags(dm, lv, layer,
|
||||||
laopts->noscan, laopts->temporary,
|
laopts->noscan, laopts->temporary,
|
||||||
0);
|
0);
|
||||||
@ -3210,12 +3210,12 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
|
|||||||
|
|
||||||
if (dm->track_pending_delete) {
|
if (dm->track_pending_delete) {
|
||||||
log_debug_activation("Using error for pending meta delete %s.", display_lvname(lv));
|
log_debug_activation("Using error for pending meta delete %s.", display_lvname(lv));
|
||||||
if (!dm_tree_node_add_error_target(dnode_meta, (uint64_t)lv->vg->extent_size * meta_len))
|
if (!dm_tree_node_add_error_target(dnode_meta, meta_size))
|
||||||
return_0;
|
return_0;
|
||||||
} else {
|
} else {
|
||||||
/* add load_segment to meta dnode: linear, size of meta area */
|
/* add load_segment to meta dnode: linear, size of meta area */
|
||||||
if (!add_linear_area_to_dtree(dnode_meta,
|
if (!add_linear_area_to_dtree(dnode_meta,
|
||||||
meta_len,
|
meta_size,
|
||||||
lv->vg->extent_size,
|
lv->vg->extent_size,
|
||||||
lv->vg->cmd->use_linear_target,
|
lv->vg->cmd->use_linear_target,
|
||||||
lv->vg->name, lv->name))
|
lv->vg->name, lv->name))
|
||||||
@ -3239,19 +3239,19 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
|
|||||||
|
|
||||||
if (dm->track_pending_delete) {
|
if (dm->track_pending_delete) {
|
||||||
log_debug_activation("Using error for pending data delete %s.", display_lvname(lv));
|
log_debug_activation("Using error for pending data delete %s.", display_lvname(lv));
|
||||||
if (!dm_tree_node_add_error_target(dnode_data, (uint64_t)lv->vg->extent_size * data_len))
|
if (!dm_tree_node_add_error_target(dnode_data, data_size))
|
||||||
return_0;
|
return_0;
|
||||||
} else {
|
} else {
|
||||||
/* add load_segment to data dnode: linear, size of data area */
|
/* add load_segment to data dnode: linear, size of data area */
|
||||||
if (!add_linear_area_to_dtree(dnode_data,
|
if (!add_linear_area_to_dtree(dnode_data,
|
||||||
data_len,
|
data_size,
|
||||||
lv->vg->extent_size,
|
lv->vg->extent_size,
|
||||||
lv->vg->cmd->use_linear_target,
|
lv->vg->cmd->use_linear_target,
|
||||||
lv->vg->name, lv->name))
|
lv->vg->name, lv->name))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
/* add seg_area to prev load_seg: offset 0 maps to cachepool lv after meta */
|
/* add seg_area to prev load_seg: offset 0 maps to cachepool lv after meta */
|
||||||
if (!dm_tree_node_add_target_area(dnode_data, NULL, dlid_pool, meta_len))
|
if (!dm_tree_node_add_target_area(dnode_data, NULL, dlid_pool, meta_size))
|
||||||
return_0;
|
return_0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user