mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvconvert: thin convert locking
Fix locking when converting thick to thin LV, ensure we take pool lock for shared VG.
This commit is contained in:
parent
bdcfd2d730
commit
8eb3a5b557
@ -3398,6 +3398,7 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
|
||||
* data and meta LVs (they are unlocked and deleted below.)
|
||||
*/
|
||||
if (vg_is_shared(vg)) {
|
||||
lv->lock_args = NULL;
|
||||
pool_lv->lock_args = NULL;
|
||||
data_lv->lock_args = NULL;
|
||||
metadata_lv->lock_args = NULL;
|
||||
@ -3455,6 +3456,10 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
|
||||
goto_bad;
|
||||
|
||||
if (to_thin) {
|
||||
if (!lockd_lv(cmd, pool_lv, "ex", LDLV_PERSISTENT)) {
|
||||
log_error("Failed to lock pool LV %s.", display_lvname(pool_lv));
|
||||
goto out;
|
||||
}
|
||||
if (!lv_update_and_reload(lv))
|
||||
goto_bad;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user