2009-05-15 22:00:20 +02:00
|
|
|
This is still very primitive support of drbd in lvm2.
|
|
|
|
Can we use some /sys information for this ?
|
2012-10-18 10:15:42 +02:00
|
|
|
Index: LVM2.2.02.58/lib/cache/lvmcache.c
|
|
|
|
================================================================================
|
|
|
|
--- LVM2.2.02.58/lib/cache/lvmcache.c
|
|
|
|
+++ LVM2.2.02.58/lib/cache/lvmcache.c
|
|
|
|
@@ -1222,6 +1222,14 @@
|
|
|
|
dev_subsystem_name(existing->dev),
|
2009-05-15 22:00:20 +02:00
|
|
|
dev_name(existing->dev));
|
|
|
|
return NULL;
|
|
|
|
+ } else if (MAJOR(existing->dev->dev) == drbd_major() &&
|
|
|
|
+ MAJOR(dev->dev) != drbd_major()) {
|
|
|
|
+ log_very_verbose("Ignoring duplicate PV %s on "
|
|
|
|
+ "%s - using drbd %s",
|
|
|
|
+ pvid, dev_name(dev),
|
|
|
|
+ dev_name(existing->dev));
|
|
|
|
+ return NULL;
|
2012-10-18 10:15:42 +02:00
|
|
|
+
|
|
|
|
} else if (dm_is_dm_major(MAJOR(existing->dev->dev)) &&
|
|
|
|
!dm_is_dm_major(MAJOR(dev->dev))) {
|
|
|
|
log_very_verbose("Ignoring duplicate PV %s on "
|
|
|
|
@@ -1242,6 +1250,12 @@
|
2009-05-15 22:00:20 +02:00
|
|
|
"using dm %s", pvid,
|
|
|
|
dev_name(existing->dev),
|
|
|
|
dev_name(dev));
|
|
|
|
+ else if (MAJOR(existing->dev->dev) != drbd_major() &&
|
|
|
|
+ MAJOR(dev->dev) == drbd_major())
|
|
|
|
+ log_very_verbose("Duplicate PV %s on %s - "
|
|
|
|
+ "using drbd %s", pvid,
|
|
|
|
+ dev_name(existing->dev),
|
|
|
|
+ dev_name(dev));
|
|
|
|
/* FIXME If both dm, check dependencies */
|
|
|
|
//else if (dm_is_dm_major(MAJOR(existing->dev->dev)) &&
|
|
|
|
//dm_is_dm_major(MAJOR(dev->dev)))
|
2012-10-18 10:15:42 +02:00
|
|
|
--- LVM2.2.02.58/lib/filters/filter.c
|
|
|
|
+++ LVM2.2.02.58/lib/filters/filter.c
|
|
|
|
@@ -54,6 +54,13 @@
|
2009-05-15 22:00:20 +02:00
|
|
|
return _md_major;
|
|
|
|
}
|
|
|
|
|
|
|
|
+/* FIXME: Should we consider filter out non-primary
|
|
|
|
+ drbd resource ?? */
|
|
|
|
+int drbd_major(void)
|
|
|
|
+{
|
2012-10-18 10:15:42 +02:00
|
|
|
+ return _drbd_major;
|
2009-05-15 22:00:20 +02:00
|
|
|
+}
|
|
|
|
+
|
2012-10-18 10:15:42 +02:00
|
|
|
int blkext_major(void)
|
|
|
|
{
|
|
|
|
return _blkext_major;
|