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

raid: move syncing with udev into function

Since _deactivate_and_remove_lvs() is used in more then one place,
move the needed udev synchronization into this function so other
users automatically get correct fs state before next dm manipulation.

Assumption here is that this udev synchronization 'delay' may also
prevent to 'early' table reloads which might cause kernel problems
for md-core - but we may need more generic time-limited reload
frequency for raid devices.

Note: on udev-less system there will be almost no delay.
This commit is contained in:
Zdenek Kabelac 2017-07-20 13:46:39 +02:00
parent 7b048f6b43
commit c78316b7a5
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.173 -
=================================
Add synchornization points with udev during conversion of raid LVs.
Improve --size args validation and report more detailed error message.
Initialize debugging mutex before any debug message in clvmd.
Log error instad of warn when noticing connection problem with lvmetad.

View File

@ -329,6 +329,13 @@ static int _deactivate_and_remove_lvs(struct volume_group *vg, struct dm_list *r
return_0;
}
/* Wait for events following any deactivation. */
if (!sync_local_dev_names(vg->cmd)) {
log_error("Failed to sync local devices after removing %u LVs in VG %s.",
dm_list_size(removal_lvs), vg->name);
return 0;
}
return 1;
}
@ -3852,13 +3859,6 @@ static int _eliminate_extracted_lvs_optional_write_vg(struct volume_group *vg,
if (!_deactivate_and_remove_lvs(vg, removal_lvs))
return_0;
/* Wait for events following any deactivation. */
if (!sync_local_dev_names(vg->cmd)) {
log_error("Failed to sync local devices after removing %u LVs in VG %s.",
dm_list_size(removal_lvs), vg->name);
return 0;
}
dm_list_init(removal_lvs);
if (vg_write_requested) {