1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
lvm2/tools
Alasdair G Kergon 1d0a2b919f toollib: fix ignored_mdas process_each_pv rescan
In process_each_pv() if we haven't yet scanned and the PV appears
to be an orphan, we must scan the other PVs looking for mdas that
reference it to find out what VG it is in.

1. If the PV has no mdas, we must scan.
2. If the PV has an mda that is not ignored we do not need to scan.
3. If the PV has an mda that is ignored, we do need to scan.

This patch fixes case 3.

> pvs -o +mda_count,vg_mda_count /dev/loop[0123]
  PV         VG   Fmt  Attr PSize  PFree  #PMda #VMda
  /dev/loop0 vg3  lvm2 a-   96.00m 96.00m     0     1
  /dev/loop1 vg3  lvm2 a-   96.00m 96.00m     1     1
  /dev/loop2 vg2  lvm2 a-   96.00m 96.00m     1     2
  /dev/loop3 vg2  lvm2 a-   28.00m 28.00m     1     2

Before:
> pvs /dev/loop2 /dev/loop3 /dev/loop0 /dev/loop1 --unbuffered
  PV         VG   Fmt  Attr PSize   PFree
  /dev/loop2      lvm2 a--  100.00m 100.00m
  /dev/loop3 vg2  lvm2 a--   28.00m  28.00m
  /dev/loop0      lvm2 a--  100.00m 100.00m
  /dev/loop1 vg3  lvm2 a--   96.00m  96.00m

After:
> pvs /dev/loop2 /dev/loop3 /dev/loop0 /dev/loop1 --unbuffered
  PV         VG   Fmt  Attr PSize  PFree
  /dev/loop2 vg2  lvm2 a--  96.00m 96.00m
  /dev/loop3 vg2  lvm2 a--  28.00m 28.00m
  /dev/loop0 vg3  lvm2 a--  96.00m 96.00m
  /dev/loop1 vg3  lvm2 a--  96.00m 96.00m
2012-06-29 21:22:09 +01:00
..
.exported_symbols generate liblvm2cmd exported symbols too 2010-06-25 18:23:10 +00:00
.gitignore More .gitignore files for an in-source-tree build. 2012-06-08 16:34:43 +01:00
args.h args: add --activate synonym for --available arg 2012-06-28 09:42:44 -04:00
cmdnames.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
commands.h lvcreate: add --activate ay (autoactivate) 2012-06-28 09:44:07 -04:00
dmsetup.c Remove unsupported udev_get_dev_path libudev call used for checking udev dir. 2012-05-29 08:09:10 +00:00
dumpconfig.c Move dm_config_write out of libdm, back to lib/config, as config_write. 2011-12-11 23:18:20 +00:00
formats.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvchange.c lvchange: add --activate ay (autoactivate) 2012-06-28 09:44:07 -04:00
lvconvert.c thin: fix lvconvert error path NULL dereference 2012-06-22 13:50:21 +02:00
lvcreate.c lvcreate: add --activate ay (autoactivate) 2012-06-28 09:44:07 -04:00
lvdisplay.c Rework the toollib interface (process_each_*) on top of new vg_read. 2009-07-01 17:00:50 +00:00
lvextend.c Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
lvm2cmd-static.c Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
lvm2cmd.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvm2cmd.h Keep the LVM-based dmeventd plugins from trying to manipulate the dmeventd 2011-10-19 08:46:26 +00:00
lvm2cmdline.h Support repetition of --addtag and --deltag arguments. 2010-11-11 17:29:05 +00:00
lvm-static.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvm.c Remove unneeded assignments 2012-02-08 11:36:18 +00:00
lvmchange.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvmcmdlib.c Keep the LVM-based dmeventd plugins from trying to manipulate the dmeventd 2011-10-19 08:46:26 +00:00
lvmcmdline.c activate: add autoactivation hooks 2012-06-28 09:42:47 -04:00
lvmdiskscan.c Few more close and dev_close trace 2012-03-01 21:12:37 +00:00
lvreduce.c Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
lvremove.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvrename.c Do not allow users to change the name of RAID sub-LVs or the name of the 2011-12-01 00:09:34 +00:00
lvresize.c cleanup: use struct initializers instead of memset 2012-06-20 14:47:54 +02:00
lvscan.c Do not check for open_count when not needed. 2011-02-03 01:24:46 +00:00
Makefile.in Reflect new file locations, include file updates etc. 2012-02-28 18:35:04 +00:00
polldaemon.c Check for error from dup2 2012-03-01 23:20:45 +00:00
polldaemon.h Start using 64-bit status flags - most of the code already handles them. 2011-09-06 18:49:31 +00:00
pvchange.c Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
pvck.c Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
pvcreate.c Using enum types for enums 2012-02-28 14:24:57 +00:00
pvdisplay.c Replace free_vg with release_vg 2011-08-10 20:25:29 +00:00
pvmove.c Fail early if cmirror is not detected and pvmove requires it. 2012-03-27 12:01:22 +00:00
pvremove.c activate: add autoactivation hooks 2012-06-28 09:42:47 -04:00
pvresize.c Using enum types for enums 2012-02-28 14:24:57 +00:00
pvscan.c pvscan: add --activate ay option (autoactivate) 2012-06-28 09:44:03 -04:00
reporter.c Add internal error for unsupported code paths 2012-02-13 11:25:56 +00:00
segtypes.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
stub.h Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
toollib.c toollib: fix ignored_mdas process_each_pv rescan 2012-06-29 21:22:09 +01:00
toollib.h Initialize dmeventd monitoring for every command 2012-02-15 15:18:43 +00:00
tools.h activate: add autoactivation hooks 2012-06-28 09:42:47 -04:00
vgcfgbackup.c Replace snprintf with dm_snprintf 2012-02-08 11:40:02 +00:00
vgcfgrestore.c The lvmetad client-side integration. Only active when use_lvmetad = 1 is set in 2012-02-23 13:11:07 +00:00
vgchange.c vgchange: add --activate ay option (autoactivate) 2012-06-28 09:42:48 -04:00
vgck.c Make vgck warn about missing PVs. 2010-07-27 20:05:29 +00:00
vgconvert.c Using enum types for enums 2012-02-28 14:24:57 +00:00
vgcreate.c The lvmetad client-side integration. Only active when use_lvmetad = 1 is set in 2012-02-23 13:11:07 +00:00
vgdisplay.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
vgexport.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
vgextend.c Replace free_vg with release_vg 2011-08-10 20:25:29 +00:00
vgimport.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
vgmerge.c Backtrace for failing drop_cached_metadata 2012-03-01 21:16:44 +00:00
vgmknodes.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
vgreduce.c Fix unlocking in error path of vgreduce 2012-03-30 14:59:35 +00:00
vgremove.c Make force_t enum usage obvious 2012-02-27 10:06:58 +00:00
vgrename.c Backtrace for failing drop_cached_metadata 2012-03-01 21:16:44 +00:00
vgscan.c Add 'vgscan --cache' functionality for consistency with 'pvscan --cache'. 2012-03-27 11:04:46 +00:00
vgsplit.c Fix vgsplit when there are mirrors that have mirrored logs. 2011-10-06 14:17:45 +00:00