]> sourceware.org Git - lvm2.git/commit
Check for duplicate paths (pvids) on the commandline of vgcreate.
authorDave Wysochanski <dwysocha@redhat.com>
Thu, 8 Apr 2010 15:18:35 +0000 (15:18 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Thu, 8 Apr 2010 15:18:35 +0000 (15:18 +0000)
commit34573cf6a5ec5162322fb6088435c07eed6e0da7
treedccbc53674518d55b28f904732e7677c473d1ca9
parent491ef790c25e856899af360d6c9c349abe7a4b77
Check for duplicate paths (pvids) on the commandline of vgcreate.

A user specifying duplicate paths on the cmdline of vgcreate will
get a message similar to the following:
vgcreate vgtest2 /dev/loop3 /dev/loop5
  Found duplicate PV jk1lXsKzwyOKlXq6bhaFFKMQQ06oPgu8: using /dev/loop5 not /dev/loop3
  Found duplicate PV jk1lXsKzwyOKlXq6bhaFFKMQQ06oPgu8: using /dev/loop3 not /dev/loop5
  Internal error: Duplicate PV id jk1lXs-Kzwy-OKlX-q6bh-aFFK-MQQ0-6oPgu8 detected for /dev/loop3 in vgtest2.

This is caught by vg_validate(), but it would be good to find
this condition earlier in the vgcreate code.  add_pv_to_vg()
currently checks by pvname, but does not look for duplcate pvids.
This patch adds the check for duplicate pvids and results in new
error output as follows:
vgcreate vgtest2 /dev/loop3 /dev/loop5
  Found duplicate PV jk1lXsKzwyOKlXq6bhaFFKMQQ06oPgu8: using /dev/loop5 not /dev/loop3
  Found duplicate PV jk1lXsKzwyOKlXq6bhaFFKMQQ06oPgu8: using /dev/loop3 not /dev/loop5
  Physical volume '/dev/loop5 (jk1lXs-Kzwy-OKlX-q6bh-aFFK-MQQ0-6oPgu8)' listed more than once.
  Unable to add physical volume '/dev/loop5' to volume group 'vgtest2'.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
lib/metadata/metadata.c
This page took 0.033223 seconds and 5 git commands to generate.