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

lvchange: better --refresh of raid and mirrors

Use lv_check_not_in_use() to detect openned device.
Plain info.open_count is not good enough for udev random
device openning.
This commit is contained in:
Zdenek Kabelac 2014-06-19 11:58:28 +02:00
parent 57faf97e6f
commit aa3e413093
2 changed files with 2 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
Fix open_count test for lvchange --refresh or mirrors and raids.
Update pvs,vgs,lvs and lvm man page for selection support.
Add -S/--select to lvm devtypes for report selection.
Add -S/--select to pvs,vgs,lvs and {pv,vg,lv}display -C for report selection.

View File

@ -347,7 +347,7 @@ static int lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
}
if (lv_info(cmd, lv, 0, &info, 1, 0)) {
if (info.open_count) {
if (!lv_check_not_in_use(cmd, lv, &info)) {
log_error("Can't resync open logical volume \"%s\"",
lv->name);
return 0;
@ -363,9 +363,6 @@ static int lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
return 0;
}
if (sigint_caught())
return_0;
active = 1;
if (lv_is_active_exclusive_locally(lv))
exclusive = 1;