1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-24 17:57:48 +03:00

lvrename: move the lvmlockd LV lock

The function it was in is used for various
internal renaming of hidden LVs where a lock
from lvmlockd does not apply.
This commit is contained in:
David Teigland 2015-12-09 11:51:25 -06:00
parent dcd946e95a
commit bdba4e7a93
2 changed files with 12 additions and 12 deletions

View File

@ -4247,18 +4247,6 @@ int lv_rename_update(struct cmd_context *cmd, struct logical_volume *lv,
return 0;
}
/*
* The lvmlockd LV lock is only acquired here to ensure the LV is not
* active on another host. This requests a transient LV lock.
* If the LV is active, a persistent LV lock already exists in
* lvmlockd, and the transient lock request does nothing.
* If the LV is not active, then no LV lock exists and the transient
* lock request acquires the LV lock (or fails). The transient lock
* is automatically released when the command exits.
*/
if (!lockd_lv(cmd, lv, "ex", 0))
return_0;
if (update_mda && !archive(vg))
return_0;

View File

@ -46,6 +46,18 @@ static int _lvrename_single(struct cmd_context *cmd, const char *vg_name,
goto bad;
}
/*
* The lvmlockd LV lock is only acquired here to ensure the LV is not
* active on another host. This requests a transient LV lock.
* If the LV is active, a persistent LV lock already exists in
* lvmlockd, and the transient lock request does nothing.
* If the LV is not active, then no LV lock exists and the transient
* lock request acquires the LV lock (or fails). The transient lock
* is automatically released when the command exits.
*/
if (!lockd_lv(cmd, lvl->lv, "ex", 0))
goto_bad;
if (!lv_rename(cmd, lvl->lv, lp->lv_name_new))
goto_bad;