mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvrename: fix lockd LV locking
lvrename should not be done if the LV is active on another host. This check was mistakenly removed when the code was changed to use LV uuids in locks rather than LV names.
This commit is contained in:
parent
597de9d586
commit
53c08f0bba
@ -4205,6 +4205,18 @@ 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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user