mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvconvert: fix lockd LV locking
Request a transient LV lock from lvmlockd when converting an LV. If the LV is inactive when lvconvert is run, the LV lock will be acquired and then released when the command is done. If the LV is active, a persistent lock exists already and the transient lock request does nothing. This fixes the issue that had been mentioned in the comment previously.
This commit is contained in:
parent
53c08f0bba
commit
819dc1845e
@ -3427,14 +3427,12 @@ static int lvconvert_single(struct cmd_context *cmd, struct lvconvert_params *lp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the lv is inactive before and after the command, the
|
* Request a transient lock. If the LV is active, it has a persistent
|
||||||
* use of PERSISTENT here means the lv will remain locked as
|
* lock already, and this request does nothing. If the LV is not
|
||||||
* an effect of running the lvconvert.
|
* active, this acquires a transient lock that will be released when
|
||||||
* To unlock it, it would need to be activated+deactivated.
|
* the command exits.
|
||||||
* Or, we could identify the commands for which the lv remains
|
|
||||||
* inactive, and not use PERSISTENT here for those cases.
|
|
||||||
*/
|
*/
|
||||||
if (!lockd_lv(cmd, lv, "ex", LDLV_PERSISTENT))
|
if (!lockd_lv(cmd, lv, "ex", 0))
|
||||||
goto_bad;
|
goto_bad;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user