diff options
author | David Teigland <teigland@redhat.com> | 2015-12-01 14:09:01 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2015-12-14 14:26:47 -0600 |
commit | 796461a9125a8324a63be154fc998245617e5990 (patch) | |
tree | c7f75bf2a6f739c23cb2771c608df637a5c13a9e /tools/commands.h | |
parent | 37bd35bc3ddbd4b669c523e2f56aaa68682df2ad (diff) | |
download | lvm2-796461a9125a8324a63be154fc998245617e5990.tar.gz |
vgrename: use process_each_vgdev-dct-vgrename
Use process_each_vg() to lock and read the old VG,
and then call the main vgrename code.
When real VG names are used (not a UUID in place of the
old name), the command still pre-locks the new name
(when strcmp wants it locked first), before calling
process_each_vg on the old name.
In the case where the old name is replaced with a UUID,
process_each_vg now translates that UUID into the real
VG name, which it locks and reads. In this case, we
cannot do pre-locking to maintain lock ordering because
the old name is unknown. So, in this case the strcmp
based lock ordering is suppressed and the old name is
always locked first. This opens a remote chance for
lock ordering conflict between racing vgrenames between
two names where one or both commands use the UUID.
Diffstat (limited to 'tools/commands.h')
-rw-r--r-- | tools/commands.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/commands.h b/tools/commands.h index 8c5162b2e..a10d8a3b5 100644 --- a/tools/commands.h +++ b/tools/commands.h @@ -1323,7 +1323,7 @@ xx(vgremove, xx(vgrename, "Rename a volume group", - ALLOW_UUID_AS_NAME, + ALLOW_UUID_AS_NAME | REQUIRES_FULL_LABEL_SCAN, "vgrename\n" "\t[-A|--autobackup y|n]\n" "\t[--commandprofile ProfileName]\n" |