1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

vgcreate: remove the lvmcache locking workaround

Recent cleanups and simplifications to lvmcache and locking
mean that the odd locking to workaround other issues is now
unnecessary.
This commit is contained in:
David Teigland 2019-04-30 14:26:16 -05:00
parent 366c1ac15b
commit d7054cd28a

View File

@ -91,15 +91,6 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
/*
* FIXME: we have to unlock/relock the new VG name around the pvcreate
* step because pvcreate needs to destroy lvmcache, which doesn't allow
* any locks to be held. There shouldn't be any reason to require this
* VG lock to be released, so the lvmcache destroy rule about locks
* seems to be unwarranted here.
*/
unlock_vg(cmd, NULL, vp_new.vg_name);
if (!(handle = init_processing_handle(cmd, NULL))) {
log_error("Failed to initialize processing handle.");
return ECMD_FAILED;
@ -110,12 +101,6 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv)
return_ECMD_FAILED;
}
/* Relock the new VG name, see comment above. */
if (!lock_vol(cmd, vp_new.vg_name, LCK_VG_WRITE, NULL)) {
destroy_processing_handle(cmd, handle);
return_ECMD_FAILED;
}
if (!(vg = vg_create(cmd, vp_new.vg_name)))
goto_bad;