mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
RAID: Revert previous commit that allowed identical table loads.
Revert commit 31c24dd9f2
. This commit
was used to force a RAID device-mapper table to be loaded into the
kernel despite the fact that it was identical to the one already
loaded. The effect allowed a RAID array with a transiently failed
device to refresh and reintegrate the failed device. This operation
is better done in the kernel on a 'resume'. Since,
'lvchange --refresh' already performs a suspend/resume cycle, the
above commit is not needed once the kernel change is made. Reverting
the commit removes an unnecessary (at least for now) change to the
device-mapper interface.
This commit is contained in:
parent
ff64e3500f
commit
faeea37057
@ -161,7 +161,6 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
|
||||
uint32_t s;
|
||||
uint64_t flags = 0;
|
||||
uint64_t rebuilds = 0;
|
||||
char *raid_health = NULL;
|
||||
|
||||
if (!seg->area_count) {
|
||||
log_error(INTERNAL_ERROR "_raid_add_target_line called "
|
||||
@ -191,20 +190,6 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
|
||||
if (mirror_in_sync())
|
||||
flags = DM_NOSYNC;
|
||||
|
||||
/*
|
||||
* If the RAID LV is not 'PARTIAL' and the status indicates
|
||||
* that the array has failed devices, it means that the
|
||||
* failed devices have returned and can be reintegrated.
|
||||
*
|
||||
* We reload the (potentially identical) table to force the
|
||||
* kernel to re-read the RAID superblocks - possibly restoring
|
||||
* transiently failed devices.
|
||||
*/
|
||||
if (!(seg->lv->status & PARTIAL_LV) &&
|
||||
lv_raid_dev_health(seg->lv, &raid_health) &&
|
||||
strchr(raid_health, 'D'))
|
||||
dm_tree_node_force_identical_table_reload(node);
|
||||
|
||||
if (!dm_tree_node_add_raid_target(node, len, _raid_name(seg),
|
||||
seg->region_size, seg->stripe_size,
|
||||
rebuilds, flags))
|
||||
|
@ -501,14 +501,13 @@ struct dm_tree_node *dm_tree_next_child(void **handle,
|
||||
uint32_t inverted);
|
||||
|
||||
/*
|
||||
* Get and set properties of a node.
|
||||
* Get properties of a node.
|
||||
*/
|
||||
const char *dm_tree_node_get_name(const struct dm_tree_node *node);
|
||||
const char *dm_tree_node_get_uuid(const struct dm_tree_node *node);
|
||||
const struct dm_info *dm_tree_node_get_info(const struct dm_tree_node *node);
|
||||
void *dm_tree_node_get_context(const struct dm_tree_node *node);
|
||||
int dm_tree_node_size_changed(const struct dm_tree_node *dnode);
|
||||
int dm_tree_node_force_identical_table_reload(struct dm_tree_node *dnode);
|
||||
|
||||
/*
|
||||
* Returns the number of children of the given node (excluding the root node).
|
||||
|
@ -232,16 +232,6 @@ struct load_properties {
|
||||
|
||||
/* Send messages for this node in preload */
|
||||
unsigned send_messages;
|
||||
|
||||
/*
|
||||
* If a mapping table is replacing an existing identical table,
|
||||
* the load is suppressed by default - avoiding the construction
|
||||
* of an unnecessary in-kernel table. Sometimes we want to avoid
|
||||
* this optimization and load the identical table anyway. This
|
||||
* field is used to indicate that we desire identical tables to be
|
||||
* loaded and not suppressed.
|
||||
*/
|
||||
unsigned force_identical_table_reload;
|
||||
};
|
||||
|
||||
/* Two of these used to join two nodes with uses and used_by. */
|
||||
@ -597,13 +587,6 @@ int dm_tree_node_size_changed(const struct dm_tree_node *dnode)
|
||||
return dnode->props.size_changed;
|
||||
}
|
||||
|
||||
int dm_tree_node_force_identical_table_reload(struct dm_tree_node *dnode)
|
||||
{
|
||||
dnode->props.force_identical_table_reload = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int dm_tree_node_num_children(const struct dm_tree_node *node, uint32_t inverted)
|
||||
{
|
||||
if (inverted) {
|
||||
@ -2426,8 +2409,7 @@ static int _load_node(struct dm_tree_node *dnode)
|
||||
seg, &seg_start))
|
||||
goto_out;
|
||||
|
||||
if (!dnode->props.force_identical_table_reload &&
|
||||
!dm_task_suppress_identical_reload(dmt))
|
||||
if (!dm_task_suppress_identical_reload(dmt))
|
||||
log_error("Failed to suppress reload of identical tables.");
|
||||
|
||||
if ((r = dm_task_run(dmt))) {
|
||||
|
Loading…
Reference in New Issue
Block a user