Ancient SUSE patches
cover Ancient SUSE patches
Hi all,
here are two ancient SUSE patches which for some reason never got sent upstream.
Thomas Fehr (1):
Fix pvdisplay to refer to sectors, not KB
Xinwei Hu (1):
Handle duplicate PVs on drbd
lib/cache/lvmcache.c | 14 ++++++++++++++ man/pvdisplay.8.in | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.1.4
PATCH 1/2 Fix pvdisplay to refer to sectors, not KB
From: Thomas Fehr <[email protected]>
The size is displayed in sectors, not kilobytes.
--- man/pvdisplay.8.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man/pvdisplay.8.in +1 -1
@@ -65,7 +65,7 @@ The values are: * physical volume device name * volume group name -* physical volume size in kilobytes +* physical volume size in sectors * internal physical volume number (obsolete) * physical volume status * physical volume (not) allocatable
Signature · 1 line
1.8.1.4
PATCH 1/2 Fix pvdisplay to refer to sectors, not KB
Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
Quoted 15 lines
From: Thomas Fehr <[email protected]>
The size is displayed in sectors, not kilobytes.
Signed-off-by Thomas Fehr <[email protected]>Acked-by Hannes Reinecke <[email protected]>--- man/pvdisplay.8.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)man/pvdisplay.8.in +0
-0
man/pvdisplay.8.in The values are: · line 71
Quoted 8 lines
man/pvdisplay.8.in +1
-1@@ -65,7 +65,7 @@ The values are: * physical volume device name * volume group name -* physical volume size in kilobytes +* physical volume size in sectors * internal physical volume number (obsolete) * physical volume status * physical volume (not) allocatable
Hi
Against which version of lvm2 is this patch ?
Since my upstream pvdisplay shows size in 'human readable' format i.e.:
(So definitely not in sector - unless used with option '--units s')
--- Physical volume ---
PV Name /dev/loop0 VG Name vg PV Size 976,56 GiB / not usable 0 Allocatable yes PE Size 32,00 KiB Total PE 31999968 Free PE 31999872 Allocated PE 96 PV UUID 5DOVI6-ioCm-LJvd-JbwQ-qJc3-FWO4-yQCjGY
Zdenek
PATCH 1/2 Fix pvdisplay to refer to sectors, not KB
Quoted 34 lines · Zdenek Kabelac
Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
Quoted 15 lines
From: Thomas Fehr <[email protected]>
The size is displayed in sectors, not kilobytes.
Signed-off-by Thomas Fehr <[email protected]>Acked-by Hannes Reinecke <[email protected]>--- man/pvdisplay.8.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)man/pvdisplay.8.in +0
-0man/pvdisplay.8.in The values are: · line 71
Quoted 8 lines
man/pvdisplay.8.in +1
-1@@ -65,7 +65,7 @@ The values are: * physical volume device name * volume group name -* physical volume size in kilobytes +* physical volume size in sectors * internal physical volume number (obsolete) * physical volume status * physical volume (not) allocatableHi
Against which version of lvm2 is this patch ?
Since my upstream pvdisplay shows size in 'human readable' format i.e.:
(So definitely not in sector - unless used with option '--units s')--- Physical volume ---
Quoted 10 lines
PV Name /dev/loop0 VG Name vg PV Size 976,56 GiB / not usable 0 Allocatable yes PE Size 32,00 KiB Total PE 31999968 Free PE 31999872 Allocated PE 96 PV UUID 5DOVI6-ioCm-LJvd-JbwQ-qJc3-FWO4-yQCjGY
Did I mention that these patches are ancient?
(Originally developed in 2007 ...)
I'm just doing house-keeping for our lvm2 package at the moment. So I'm not at all surprised this patch is obsolete.
Thanks for the info; please disregard this patch.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke zSeries & Storage hare at suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg GF: J. Hawn, J. Guild, F. Imend?rffer, HRB 16746 (AG N?rnberg)
PATCH 1/2 Fix pvdisplay to refer to sectors, not KB
Dne 18.3.2014 10:11, Hannes Reinecke napsal(a):
Quoted 45 lines · Zdenek Kabelac
Quoted 34 lines
Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
Quoted 15 lines
From: Thomas Fehr <[email protected]>
The size is displayed in sectors, not kilobytes.
Signed-off-by Thomas Fehr <[email protected]>Acked-by Hannes Reinecke <[email protected]>--- man/pvdisplay.8.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)man/pvdisplay.8.in +0
-0man/pvdisplay.8.in The values are: · line 71
Quoted 8 lines
man/pvdisplay.8.in +1
-1@@ -65,7 +65,7 @@ The values are: * physical volume device name * volume group name -* physical volume size in kilobytes +* physical volume size in sectors * internal physical volume number (obsolete) * physical volume status * physical volume (not) allocatableHi
Against which version of lvm2 is this patch ?
Since my upstream pvdisplay shows size in 'human readable' format i.e.:
(So definitely not in sector - unless used with option '--units s')--- Physical volume ---
Quoted 10 lines
PV Name /dev/loop0 VG Name vg PV Size 976,56 GiB / not usable 0 Allocatable yes PE Size 32,00 KiB Total PE 31999968 Free PE 31999872 Allocated PE 96 PV UUID 5DOVI6-ioCm-LJvd-JbwQ-qJc3-FWO4-yQCjGY
Quoted 6 lines
Did I mention that these patches are ancient?
(Originally developed in 2007 ...)I'm just doing house-keeping for our lvm2 package at the moment. So I'm not at all surprised this patch is obsolete.
Ahh - and I've missed it's for section '-c, --colon' and I guess it still applies for those printed values - since the size is there in sectors - though people are most probably using 'pvs'.
Zdenek
PATCH 2/2 Handle duplicate PVs on drbd
In reply to Hannes ReineckeFrom: Xinwei Hu <[email protected]>
If lvm finds a duplicate PV where one device is a drbd device it should prefer the drbd device.
--- lib/cache/lvmcache.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
lib/cache/lvmcache.c +14 -0
@@ -1503,6 +1503,14 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid,dev_subsystem_name (dt, existing->dev), dev_name(existing->dev));return NULL ; + }else if (MAJOR (existing->dev->dev) == dt->drbd_major && +MAJOR (dev->dev) != dt->drbd_major) { +log_very_verbose ("Ignoring duplicate PV %s on " +"%s - using drbd %s" , + pvid,dev_name (dev), +dev_name (existing->dev)); +return NULL ; + }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 "
@@ -1523,6 +1531,12 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid,"using dm %s" , pvid,dev_name (existing->dev), dev_name(dev)); + else if (MAJOR(existing->dev->dev) != dt->drbd_major && + MAJOR(dev->dev) == dt->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)))
Signature · 1 line
1.8.1.4
PATCH 2/2 Handle duplicate PVs on drbd
Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
Quoted 17 lines
From: Xinwei Hu <[email protected]>
If lvm finds a duplicate PV where one device is a drbd device it should prefer the drbd device.
Signed-off-by Xinwei Hu <[email protected]>Acked-by Hannes Reinecke <[email protected]>--- lib/cache/lvmcache.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)lib/cache/lvmcache.c +0
-0@@ -1503,6 +1503,14 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid, dev_subsystem_name(dt, existing->dev),
lib/cache/lvmcache.c struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid, · line 1513
Quoted 10 lines
lib/cache/lvmcache.c +8
-0dev_name(existing->dev));return NULL ; + }else if (MAJOR (existing->dev->dev) == dt->drbd_major && +MAJOR (dev->dev) != dt->drbd_major) { +log_very_verbose ("Ignoring duplicate PV %s on " +"%s - using drbd %s" , + pvid,dev_name (dev), +dev_name (existing->dev)); +return NULL ; +
Hi
I assume there is maybe wrong order of tests in functions:
dev_subsystem_part_major() & dev_subsystem_name() (in lib/device/dev-type.c)
Could you check if reordering tests would solve it ?
(I'm not familiar with drbd usage, however there is already code to handle this case - but maybe it's not working for all cases ?)
Zdenek