1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
LVM2 mirror repository https://sourceware.org/lvm2/
Go to file
Peter Rajnoha 756bcabbfe activation: fix autoactivation to not trigger on each PV change
Before, the pvscan --cache -aay was called on each ADD and CHANGE
uevent (for a device that is not a device-mapper device) and each CHANGE
event (for a PV that is a device-mapper device).

This causes troubles with autoactivation in some cases as CHANGE event
may originate from using the OPTION+="watch" udev rule that is defined
in 60-persistent-storage.rules (part of the rules provided by udev
directly) and it's used for all block devices
(except fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md* devices). For example, the
following sequence incorrectly activates the rest of LVs in a VG if one
of the LVs in the VG is being removed:

[root@rhel6-a ~]# pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created

[root@rhel6-a ~]# vgcreate vg /dev/sda
  Volume group "vg" successfully created

[root@rhel6-a ~]# lvcreate -l1 vg
  Logical volume "lvol0" created

[root@rhel6-a ~]# lvcreate -l1 vg
  Logical volume "lvol1" created

[root@rhel6-a ~]# vgchange -an vg
  0 logical volume(s) in volume group "vg" now active

[root@rhel6-a ~]# lvs
  LV      VG        Attr      LSize   Pool Origin Data%  Move Log
Cpy%Sync Convert
  lvol0   vg        -wi------   4.00m
  lvol1   vg        -wi------   4.00m

[root@rhel6-a ~]# lvremove -ff vg/lvol1
  Logical volume "lvol1" successfully removed

[root@rhel6-a ~]# lvs
  LV      VG        Attr      LSize   Pool Origin Data%  Move Log
Cpy%Sync Convert
  lvol0   vg        -wi-a----   4.00m

...so the vg was deactivated, then lvol1 removed, and we end up with
lvol1 removed (which is ok) BUT with lvol0 activated (which is wrong)!!!
This is because after lvol1 removal, we need to write metadata to the
underlying device /dev/sda and that causes the CHANGE event to be
generated (because of the WATCH udev rule set on this device) and this
causes the pvscan --cache -aay to be reevaluated.

We have to limit this and call pvscan --cache -aay to autoactivate
VGs/LVs only in these cases:

 --> if the *PV is not a dm device*, scan only after proper device
addition (ADD event) and not with any other changes (CHANGE event)

 --> if the *PV is a dm device*, scan only after proper mapping
activation (CHANGE event + the underlying PV in a state "just
activated")
2012-12-21 10:34:48 +01:00
autoconf Using Fedora 14's autoreconf. 2011-01-07 14:38:34 +00:00
daemons Revert "lvmetad: simplify pvid memory allocation." 2012-12-17 13:49:19 +01:00
doc thin: reworked thin feature detection 2012-12-03 11:57:40 +01:00
include libdaemon: Split daemon-shared.[hc] into daemon-io.[hc] and config-util.[hc]. 2012-09-26 17:26:23 +02:00
lib RAID: Limit replacement of devices when array is not in-sync. 2012-12-18 14:40:42 -06:00
libdaemon lvmetad: add check for failure dm_config_write_node 2012-12-15 17:23:27 +01:00
libdm cleanup: skip assignment 2012-12-15 14:57:40 +01:00
liblvm lvm2app: No special behavior for 0 for max_snap_size in lvm_lv_snapshot() 2012-12-17 14:14:38 -08:00
man lvconvert: allow lvconvert --stripes/stripesize only with -mirrors/--repair/--thinpool 2012-12-11 15:50:25 +01:00
old-tests Add .gitignore files for an in-source-tree build. 2012-06-08 16:26:21 +01:00
po INSTALL rules updates 2010-04-09 21:42:48 +00:00
python lvm2app: No special behavior for 0 for max_snap_size in lvm_lv_snapshot() 2012-12-17 14:14:38 -08:00
report-generators add copyright notices to new files 2010-07-28 12:20:38 +00:00
reports [REPORT-GENERATORS] cut down stylsheet.css to what we actually use 2010-07-21 10:00:38 +00:00
scripts systemd: remove quotes in lvm2-monitor.service ExecStop 2012-11-02 20:32:28 +01:00
test lvmetad: Fix autoactivation for MDA-less PVs. 2012-12-12 13:19:04 +01:00
tools RAID: Limit replacement of devices when array is not in-sync. 2012-12-18 14:40:42 -06:00
udev activation: fix autoactivation to not trigger on each PV change 2012-12-21 10:34:48 +01:00
unit-tests cleanup: replace memset with struct initilization 2012-06-22 13:23:03 +02:00
.gitignore gitignore: Ignore files ending in ~ 2012-06-11 16:13:02 +01:00
aclocal.m4 Add aclocal.m4 (for pkgconfig). 2011-01-07 16:27:05 +00:00
configure configure: autoreconf 2012-10-12 14:45:26 +02:00
configure.in scripts: introduce blkdeactivate 2012-10-12 14:44:24 +02:00
COPYING Outline docs 2001-12-31 16:12:40 +00:00
COPYING.LIB Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
INSTALL quick review of docs 2008-11-04 17:49:22 +00:00
make.tmpl.in python: Add bindings for liblvm2app. 2012-10-12 02:08:47 +01:00
Makefile.in Makefiles: fix distclean dir dependency 2012-10-15 14:15:59 +01:00
README Rename git report from LVM2.git to lvm2.git. 2012-06-08 17:41:43 +01:00
VERSION version: update 2012-10-22 14:16:06 +02:00
VERSION_DM version: update 2012-10-22 14:16:06 +02:00
WHATS_NEW activation: fix autoactivation to not trigger on each PV change 2012-12-21 10:34:48 +01:00
WHATS_NEW_DM thin: dmeventd fix memleak on error path 2012-12-15 17:23:27 +01:00

This tree contains the LVM2 and device-mapper tools and libraries.

For more information about LVM2 read the changelog in the WHATS_NEW file.
Installation instructions are in INSTALL.

There is no warranty - see COPYING and COPYING.LIB.

Tarballs are available from:
  ftp://sources.redhat.com/pub/lvm2/

The source code is stored in git:
  http://git.fedorahosted.org/git/lvm2.git
  git clone git://git.fedorahosted.org/git/lvm2.git

Mailing list for general discussion related to LVM2:
  linux-lvm@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

Mailing lists for LVM2 development, patches and commits:
  lvm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm

  lvm2-commits@lists.fedorahosted.org (Read-only archive of commits)
  Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits

Mailing list for device-mapper development, including kernel patches
and multipath-tools:
  dm-devel@redhat.com
  Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel

The source code repository used until 7th June 2012 is accessible here:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.