1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Abort operation if dm_tree_node_add_target_area fails.

This commit is contained in:
Alasdair Kergon 2011-07-05 23:10:14 +00:00
parent 3a8eb3870e
commit 86b15c7c90
2 changed files with 13 additions and 17 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.86 -
=================================
Abort operation if dm_tree_node_add_target_area fails.
Add activation/checks to lvm.conf to perform additional ioctl validation.
When suspending, automatically preload newly-visible existing LVs.
Report internal error when parameters are missing on table load.

View File

@ -1178,12 +1178,11 @@ static int _add_error_area(struct dev_manager *dm, struct dm_tree_node *node,
dlid = _add_error_device(dm, *tree, seg, s);
if (!dlid)
return_0;
dm_tree_node_add_target_area(node, NULL, dlid,
extent_size * seg_le(seg, s));
if (!dm_tree_node_add_target_area(node, NULL, dlid, extent_size * seg_le(seg, s)))
return_0;
} else
dm_tree_node_add_target_area(node,
dm->cmd->stripe_filler,
NULL, UINT64_C(0));
if (!dm_tree_node_add_target_area(node, dm->cmd->stripe_filler, NULL, UINT64_C(0)))
return_0;
return 1;
}
@ -1204,19 +1203,15 @@ int add_areas_line(struct dev_manager *dm, struct lv_segment *seg,
(seg_type(seg, s) == AREA_LV && !seg_lv(seg, s))) {
if (!_add_error_area(dm, node, seg, s))
return_0;
} else if (seg_type(seg, s) == AREA_PV)
dm_tree_node_add_target_area(node,
dev_name(seg_dev(seg, s)),
NULL,
(seg_pv(seg, s)->pe_start +
(extent_size * seg_pe(seg, s))));
else if (seg_type(seg, s) == AREA_LV) {
if (!(dlid = build_dm_uuid(dm->mem,
seg_lv(seg, s)->lvid.s,
NULL)))
} else if (seg_type(seg, s) == AREA_PV) {
if (!dm_tree_node_add_target_area(node, dev_name(seg_dev(seg, s)), NULL,
(seg_pv(seg, s)->pe_start + (extent_size * seg_pe(seg, s)))))
return_0;
} else if (seg_type(seg, s) == AREA_LV) {
if (!(dlid = build_dm_uuid(dm->mem, seg_lv(seg, s)->lvid.s, NULL)))
return_0;
if (!dm_tree_node_add_target_area(node, NULL, dlid, extent_size * seg_le(seg, s)))
return_0;
dm_tree_node_add_target_area(node, NULL, dlid,
extent_size * seg_le(seg, s));
} else {
log_error(INTERNAL_ERROR "Unassigned area found in LV %s.",
seg->lv->name);