From d7054cd28ae6bb2fad216f8756ab030de3e8e65e Mon Sep 17 00:00:00 2001 From: David Teigland Date: Tue, 30 Apr 2019 14:26:16 -0500 Subject: [PATCH] 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. --- tools/vgcreate.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tools/vgcreate.c b/tools/vgcreate.c index d62925f9d..626cf1558 100644 --- a/tools/vgcreate.c +++ b/tools/vgcreate.c @@ -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;