1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-11 09:18:25 +03:00

vgrename: use global lock

Should fix a reported problem of pvs seeing bad orphan
info while vgrename was running.
This commit is contained in:
David Teigland 2019-07-22 12:12:42 -05:00
parent e3c8cebd87
commit 3d980172b0

View File

@ -202,6 +202,11 @@ int vgrename(struct cmd_context *cmd, int argc, char **argv)
if (!(vp.vg_name_new = dm_pool_strdup(cmd->mem, vg_name_new)))
return_ECMD_FAILED;
if (!lock_vol(cmd, VG_GLOBAL, LCK_VG_WRITE, NULL)) {
log_error("Unable to obtain global lock.");
return_ECMD_FAILED;
}
/* Needed change the global VG namespace. */
if (!lockd_gl(cmd, "ex", LDGL_UPDATE_NAMES))
return_ECMD_FAILED;