Bug 540289 - lvm integration must not allow VG metadata changes (or monitoring)
Summary: lvm integration must not allow VG metadata changes (or monitoring)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 12
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 548555
TreeView+ depends on / blocked
 
Reported: 2009-11-22 23:53 UTC by Curtis Doty
Modified: 2010-01-28 00:52 UTC (History)
13 users (show)

Fixed In Version: 004-4.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 548555 (view as bug list)
Environment:
Last Closed: 2010-01-28 00:52:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
dracut should only use lvm with read-only locking (3.28 KB, patch)
2009-12-01 14:45 UTC, Mike Snitzer
no flags Details | Diff

Description Curtis Doty 2009-11-22 23:53:19 UTC
If I create some snapshots, these errors appear upon next boot.

Nov 22 14:01:57 localhost kernel: dracut: dracut-002-13.4.git8f397a9b.fc12
Nov 22 14:01:57 localhost kernel: udev: starting version 145
Nov 22 14:01:57 localhost kernel: dracut: Starting plymouth daemon
Nov 22 14:01:57 localhost kernel: dracut: Scanning devices sda2 sda3  for LVM volume groups
Nov 22 14:01:57 localhost kernel: dracut: Reading all physical volumes. This may take a while...
Nov 22 14:01:57 localhost kernel: dracut: Found volume group "vg_dat" using metadata type lvm2
Nov 22 14:01:57 localhost kernel: dracut: Found volume group "vg_sys" using metadata type lvm2
Nov 22 14:01:57 localhost kernel: dracut: vg_dat-lv_opt_s1: event registration failed: 342:3 libdevmapper-event-lvm2snapshot.so dlopen failed: libdevmapper-event-lvm2snapshot.so: cannot open shared object file:
Nov 22 14:01:57 localhost kernel: dracut: vg_dat/snapshot1: snapshot segment monitoring function failed.
Nov 22 14:01:57 localhost kernel: dracut: vg_dat-lv_home_s1: event registration failed: 342:7 libdevmapper-event-lvm2snapshot.so dlopen failed: libdevmapper-event-lvm2snapshot.so: cannot open shared object file:
Nov 22 14:01:57 localhost kernel: dracut: vg_dat/snapshot0: snapshot segment monitoring function failed.
Nov 22 14:01:57 localhost kernel: dracut: vg_sys-lv_swap1_s1: event registration failed: 342:11 libdevmapper-event-lvm2snapshot.so dlopen failed: libdevmapper-event-lvm2snapshot.so: cannot open shared object fil
Nov 22 14:01:57 localhost kernel: dracut: vg_sys/snapshot2: snapshot segment monitoring function failed.
Nov 22 14:01:57 localhost kernel: dracut: vg_sys-lv_root_s1: event registration failed: 342:15 libdevmapper-event-lvm2snapshot.so dlopen failed: libdevmapper-event-lvm2snapshot.so: cannot open shared object file
Nov 22 14:01:57 localhost kernel: dracut: vg_sys/snapshot1: snapshot segment monitoring function failed.
Nov 22 14:01:57 localhost kernel: dracut: vg_sys-lv_local_s1: event registration failed: 342:19 libdevmapper-event-lvm2snapshot.so dlopen failed: libdevmapper-event-lvm2snapshot.so: cannot open shared object fil
Nov 22 14:01:57 localhost kernel: dracut: vg_sys/snapshot0: snapshot segment monitoring function failed.
Nov 22 14:01:57 localhost kernel: dracut: vg_sys-lv_var_s1: event registration failed: 342:23 libdevmapper-event-lvm2snapshot.so dlopen failed: libdevmapper-event-lvm2snapshot.so: cannot open shared object file:
Nov 22 14:01:57 localhost kernel: dracut: vg_sys/snapshot3: snapshot segment monitoring function failed.
Nov 22 14:01:57 localhost kernel: dracut: 4 logical volume(s) in volume group "vg_dat" now active
Nov 22 14:01:57 localhost kernel: dracut: 8 logical volume(s) in volume group "vg_sys" now active

Comment 1 Mike Snitzer 2009-11-23 14:41:07 UTC
As the errors show, at the end, this just means that snapshot usage monitoring isn't started properly.  lvm2 starts monitoring snapshots when they are activated.  If lvm2 can load the dmeventd snapshot library (because it doesn't exist) the monitoring fails to start.

The library isn't found because dracut has not been trained to include libdevmapper-event-lvm2snapshot.so in the initramfs.

So not only should dracut add dm-snapshot.ko (if CONFIG_DM_SNAPSHOT=m) it should also be adding the dmeventd snapshot library.

Comment 2 Mike Snitzer 2009-11-23 14:45:18 UTC
(In reply to comment #1)
> As the errors show, at the end, this just means that snapshot usage monitoring
> isn't started properly.  lvm2 starts monitoring snapshots when they are
> activated.  If lvm2 can load the dmeventd snapshot library (because it doesn't
> exist) the monitoring fails to start.

That obviously should've read: "If lvm2 cannot load ..."

Comment 3 Alasdair Kergon 2009-11-23 14:51:56 UTC
Or rather:

dracut should use --monitor n on lv/vgchange, which should avoid the messages without needing to change anything else;

and

initscripts should start up monitoring on already-active LVs using lvchange --monitor -y

Comment 4 Curtis Doty 2009-11-24 02:15:50 UTC
FYI, platform is x86_64 and the i686 flavor of those libs aren't installed.

Comment 5 Mike Snitzer 2009-11-25 17:15:48 UTC
(In reply to comment #3)
> Or rather:
> 
> dracut should use --monitor n on lv/vgchange, which should avoid the messages
> without needing to change anything else;
> 
> and
> 
> initscripts should start up monitoring on already-active LVs using lvchange
> --monitor -y  

OK, so dracut's modules.d/90lvm/lvm_scan.sh should switch to using:
lvm vgchange -ay --monitor n ...

And lvm2's lvm2-monitor initscript already starts monitoring all active LVs with:
$VGCHANGE --monitor y $vg


But after some root FS snapshot-merge testing it seems that lvm2's polldaemon-based progress monitoring should also be controlled via --monitor.  Otherwise, vgchange -ay will fork the polldaemon for mirror (PVMOVE) or  snapshot-merge LVs.

It appears that the lvm2 polldaemon(s), e.g. for the root FS in the case of snapshot-merge, could still be running at the time of the initramfs' pivot.  lvm2 really should not be starting the polldaemon(s) from within the initramfs.  But they'll need to be started via the lvm2-monitor initscript.

So this begs the question: should --monitor be overloaded to also control lvm2's polldaemon-based monitoring?  I believe it should.

Comment 6 Fedora Update System 2009-11-27 15:12:15 UTC
dracut-003-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/dracut-003-1.fc12

Comment 7 Fedora Update System 2009-12-01 04:39:38 UTC
dracut-003-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dracut'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12432

Comment 8 Mike Snitzer 2009-12-01 14:45:36 UTC
Created attachment 375076 [details]
dracut should only use lvm with read-only locking

dracut-003-1.fc12 adds '--monitor n' like was discussed.  But this only fixes a symptom of the larger problem.  After further review of how lvm is used by dracut (and the read-write /var that the initramfs provides): initramfs should not allow lvm the potential to effect _any_ LVM VG metadata changes.  Using lvm's readonly locking will prevent any lvm metadata changes (and will also prevent dmeventd monitoring from being started).

Comment 9 Mike Snitzer 2009-12-01 14:50:36 UTC
Setting back to "assigned".  Changing subject from "dmeventd errors with snapshots".

dracut needs a more complete fix for how it uses lvm.

Comment 10 Mike Snitzer 2009-12-01 16:22:51 UTC
(In reply to comment #8)
> Using lvm's readonly locking will prevent any lvm metadata changes (and will
> also prevent dmeventd monitoring from being started).  

just FYI: read-only locking does _not_ prevent dmeventd monitoring from starting.

Comment 11 Carlos Martín 2009-12-08 18:12:30 UTC
This problem also arises with LVM2 mirror logical volumes.

Comment 12 Mike Snitzer 2009-12-10 22:14:14 UTC
bumping priority to reflect understanding that has been reached with dracut team (pknirsch specifically).

Comment 13 Fedora Update System 2010-01-26 10:47:31 UTC
dracut-004-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/dracut-004-4.fc12

Comment 14 Fedora Update System 2010-01-27 01:05:09 UTC
dracut-004-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dracut'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2010-1088

Comment 15 Fedora Update System 2010-01-28 00:50:24 UTC
dracut-004-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.