summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2022-04-13 12:16:57 -0500
committerDavid Teigland <teigland@redhat.com>2022-04-13 12:19:04 -0500
commitbee575d678399a45db09ec8fcba79eae3890ec54 (patch)
treed6d125781f0f16052c23141fa13e36273431379c
parentd14245c72425b99c3bc33a533da46962d010871a (diff)
downloadlvm2-bee575d678399a45db09ec8fcba79eae3890ec54.tar.gz
devices file: remove extraneous unlock in vgchange -u
vgchange -u exit path was unlocking the devices file in cases when it wasn't needed, which produced an warning.
-rw-r--r--lib/device/device_id.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 6c7136d5f..f1928347c 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -1298,15 +1298,15 @@ void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg,
int update = 0;
if (!cmd->enable_devices_file)
- goto out;
+ return;
/* Without this setting there is no stacking LVs on PVs. */
if (!cmd->scan_lvs)
- goto out;
+ return;
/* Check if any devices file entries are stacked on LVs. */
if (!_device_ids_use_lvmlv(cmd))
- goto out;
+ return;
memcpy(old_vgid, old_vg_id, ID_LEN);
memcpy(new_vgid, &vg->id, ID_LEN);
@@ -1336,7 +1336,6 @@ void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg,
if (update &&
!device_ids_write(cmd))
stack;
- out:
unlock_devices_file(cmd);
}