Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cac49725c9a2a1f5…
Commit: cac49725c9a2a1f5c0e48235a07f168d98458ace
Parent: f1dc4d3d81456d506b2c56fb2e8b12106cbd9e16
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Aug 16 15:45:00 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Aug 16 15:45:00 2013 +0200
udev: fix lvmetad rules to not ignore loop device configuration
If loop device is first configured on systems where /dev/loop-control
is used to dynamically create the loop device itself, there's an
ADD+CHANGE even generated. But next time the existing /dev/loop[0-9]*
is reused, there's only a CHANGE event since the device representing
it is already present in kernel (so no ADD event in this case).
We can't ignore this CHANGE event for loop devices! This is a regression
caused by 756bcabbfe297688ba240a880bc2b55265ad33f0. We already had
a similar problem with MD devices which was fixed by
2ac217d408470dcecb69b83d9cbf7a254747fa5b (but that one was
only an intra-release fix).
---
WHATS_NEW | 1 +
udev/69-dm-lvm-metad.rules.in | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a4df6c9..3cf3e47 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.101 -
===================================
+ Fix ignored lvmetad update on loop device configuration (2.02.99).
Use LVM_PATH instead of hardcoded value in lvm2 activation systemd generator.
Refresh existing VG before autoactivation (event retrigger/device reappeared).
Fix vgck to notice on-disk corruption even if lvmetad is used.
diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
index a0e48a1..d5087e3 100644
--- a/udev/69-dm-lvm-metad.rules.in
+++ b/udev/69-dm-lvm-metad.rules.in
@@ -21,7 +21,7 @@ SUBSYSTEM!="block", GOTO="lvm_end"
ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member", GOTO="lvm_end"
ACTION=="remove", GOTO="lvm_scan"
-ACTION=="change", KERNEL=="md[0-9]*", GOTO="lvm_scan"
+ACTION=="change", KERNEL=="md[0-9]*|loop[0-9]*", GOTO="lvm_scan"
# If the PV is not a dm device, scan only after device addition (ADD event)
KERNEL!="dm-[0-9]*", ACTION!="add", GOTO="lvm_end"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=732e609fe2e337fa…
Commit: 732e609fe2e337fa7f4c2b3308d0bc6187269947
Parent: 82d83a01ce2cac77fec2e9b763061fbfb5f01ce8
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Aug 14 15:57:52 2013 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Aug 14 16:04:01 2013 +0200
test: Fix false positives due to open devices
Something is rather randomly keeping devices open. As it is a known udev
feature, waiting for transaction may (or may not) help.
---
test/lib/aux.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index d61f17d..36de6e5 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -345,6 +345,7 @@ prepare_devs() {
disable_dev() {
local dev
+ udev_wait
init_udev_transaction
for dev in "$@"; do
maj=$(($(stat --printf=0x%t "$dev")))
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=82d83a01ce2cac77…
Commit: 82d83a01ce2cac77fec2e9b763061fbfb5f01ce8
Parent: fcbb34bdccb21f0ed4c8fe990fdc68126f1cbf4f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Aug 14 14:04:58 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Aug 14 14:04:58 2013 +0200
autoactivation: refresh existing VG before autoactivation
When autoactivating a VG, there could be an existing VG with exactly
the same PV UUIDs. The PVs could be reappeared after previous
loss/disconnect (for example disconnecting and reconnecting iscsi).
Since there's no "autodeactivation" yet, the mappings for the LVs
from the VG were left in the system even if the device was disconnected.
These mappings also hold the major:minor of the underlying device.
So if the device reappears, it is assigned a different major:minor
pair (...and kernel name). We need to cope with this during
autoactivation so any existing mappings are corrected for any changes.
The VG refresh does that (the vgchange --refresh functionality) -
call this before VG autoactivation.
(If the VG does not exist yet, the VG refresh is NOP)
---
WHATS_NEW | 1 +
tools/pvscan.c | 20 +++++++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c7fda19..903b28d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.101 -
===================================
+ Refresh existing VG before autoactivation (event retrigger/device reappeared).
Fix vgck to notice on-disk corruption even if lvmetad is used.
Move mpath device filter before partitioned filter (which opens devices).
Split partitioned filter out of lvm_type filter.
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 96bbf6b..3f16b05 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -98,6 +98,7 @@ static int _auto_activation_handler(struct cmd_context *cmd,
struct volume_group *vg;
int consistent = 0;
struct id vgid_raw;
+ int r = 0;
/* TODO: add support for partial and clustered VGs */
if (partial)
@@ -106,24 +107,29 @@ static int _auto_activation_handler(struct cmd_context *cmd,
if (!id_read_format(&vgid_raw, vgid))
return_0;
- /* NB. This is safe because we know lvmetad is running and we won't hit
- * disk. */
+ /* NB. This is safe because we know lvmetad is running and we won't hit disk. */
if (!(vg = vg_read_internal(cmd, NULL, (const char *) &vgid_raw, 0, &consistent)))
return 1;
if (vg_is_clustered(vg)) {
- release_vg(vg);
- return 1;
+ r = 1; goto out;
+ }
+
+ if (!vg_refresh_visible(vg->cmd, vg)) {
+ log_error("%s: refresh before autoactivation failed.", vg->name);
+ goto out;
}
if (!vgchange_activate(vg->cmd, vg, activate)) {
log_error("%s: autoactivation failed.", vg->name);
- release_vg(vg);
- return 0;
+ goto out;
}
+ r = 1;
+
+out:
release_vg(vg);
- return 1;
+ return r;
}
static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)