mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +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
|
||||
* use of PERSISTENT here means the lv will remain locked as
|
||||
* an effect of running the lvconvert.
|
||||
* To unlock it, it would need to be activated+deactivated.
|
||||
* Or, we could identify the commands for which the lv remains
|
||||
* inactive, and not use PERSISTENT here for those cases.
|
||||
* Request a transient lock. If the LV is active, it has a persistent
|
||||
* lock already, and this request does nothing. If the LV is not
|
||||
* active, this acquires a transient lock that will be released when
|
||||
* the command exits.
|
||||
*/
|
||||
if (!lockd_lv(cmd, lv, "ex", LDLV_PERSISTENT))
|
||||
if (!lockd_lv(cmd, lv, "ex", 0))
|
||||
goto_bad;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user