mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
snapshot: use lv_check_not_in_use
Instead of plain open_count check, try to use 'smarter' lv_check_not_in_use() function.
This commit is contained in:
parent
6d196410fc
commit
4a061a35c7
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.105 -
|
Version 2.02.105 -
|
||||||
=====================================
|
=====================================
|
||||||
|
Use lv_check_not_in_use() when testing device in use before merging.
|
||||||
Move test for target present from init_snapshot_merge() to lvconvert.
|
Move test for target present from init_snapshot_merge() to lvconvert.
|
||||||
Check for failure of lvmcache_add_mda() when writing pv.
|
Check for failure of lvmcache_add_mda() when writing pv.
|
||||||
Check for failure of dev_get_size() when reporting device size.
|
Check for failure of dev_get_size() when reporting device size.
|
||||||
|
@ -1906,18 +1906,15 @@ static int lvconvert_merge(struct cmd_context *cmd,
|
|||||||
* constructor and DM should prevent appropriate devices from
|
* constructor and DM should prevent appropriate devices from
|
||||||
* being open.
|
* being open.
|
||||||
*/
|
*/
|
||||||
if (lv_info(cmd, origin, 0, &info, 1, 0)) {
|
if (lv_info(cmd, origin, 0, &info, 1, 0) &&
|
||||||
if (info.open_count) {
|
!lv_check_not_in_use(cmd, origin, &info)) {
|
||||||
log_error("Can't merge over open origin volume");
|
log_print_unless_silent("Can't merge over open origin volume.");
|
||||||
merge_on_activate = 1;
|
merge_on_activate = 1;
|
||||||
}
|
} else if (lv_info(cmd, lv, 0, &info, 1, 0) &&
|
||||||
}
|
!lv_check_not_in_use(cmd, lv, &info)) {
|
||||||
if (lv_info(cmd, lv, 0, &info, 1, 0)) {
|
log_print_unless_silent("Can't merge when snapshot is open.");
|
||||||
if (info.open_count) {
|
|
||||||
log_print_unless_silent("Can't merge when snapshot is open");
|
|
||||||
merge_on_activate = 1;
|
merge_on_activate = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
init_snapshot_merge(snap_seg, origin);
|
init_snapshot_merge(snap_seg, origin);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user