All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Ancient SUSE patches
@ 2014-03-18  8:24 Hannes Reinecke
  2014-03-18  8:24 ` [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB Hannes Reinecke
  2014-03-18  8:24 ` [PATCH 2/2] Handle duplicate PVs on drbd Hannes Reinecke
  0 siblings, 2 replies; 7+ messages in thread
From: Hannes Reinecke @ 2014-03-18  8:24 UTC (permalink / raw)
  To: lvm-devel

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(-)

-- 
1.8.1.4



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB
  2014-03-18  8:24 [PATCH 0/2] Ancient SUSE patches Hannes Reinecke
@ 2014-03-18  8:24 ` Hannes Reinecke
  2014-03-18  8:57   ` Zdenek Kabelac
  2014-03-18  8:24 ` [PATCH 2/2] Handle duplicate PVs on drbd Hannes Reinecke
  1 sibling, 1 reply; 7+ messages in thread
From: Hannes Reinecke @ 2014-03-18  8:24 UTC (permalink / raw)
  To: lvm-devel

From: Thomas Fehr <fehr@suse.de>

The size is displayed in sectors, not kilobytes.

Signed-off-by: Thomas Fehr <fehr@suse.de>
Acked-by: Hannes Reinecke <hare@suse.de>
---
 man/pvdisplay.8.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/pvdisplay.8.in b/man/pvdisplay.8.in
index 03c12c4..13c26b5 100644
--- a/man/pvdisplay.8.in
+++ b/man/pvdisplay.8.in
@@ -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
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] Handle duplicate PVs on drbd
  2014-03-18  8:24 [PATCH 0/2] Ancient SUSE patches Hannes Reinecke
  2014-03-18  8:24 ` [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB Hannes Reinecke
@ 2014-03-18  8:24 ` Hannes Reinecke
  2014-03-18  9:10   ` Zdenek Kabelac
  1 sibling, 1 reply; 7+ messages in thread
From: Hannes Reinecke @ 2014-03-18  8:24 UTC (permalink / raw)
  To: lvm-devel

From: Xinwei Hu <xwhu@suse.de>

If lvm finds a duplicate PV where one device is a drbd device
it should prefer the drbd device.

Signed-off-by: Xinwei Hu <xwhu@suse.de>
Acked-by: Hannes Reinecke <hare@suse.de>
---
 lib/cache/lvmcache.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index d40bdce..ebc619b 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -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)))
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB
  2014-03-18  8:24 ` [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB Hannes Reinecke
@ 2014-03-18  8:57   ` Zdenek Kabelac
  2014-03-18  9:11     ` Hannes Reinecke
  0 siblings, 1 reply; 7+ messages in thread
From: Zdenek Kabelac @ 2014-03-18  8:57 UTC (permalink / raw)
  To: lvm-devel

Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
> From: Thomas Fehr <fehr@suse.de>
>
> The size is displayed in sectors, not kilobytes.
>
> Signed-off-by: Thomas Fehr <fehr@suse.de>
> Acked-by: Hannes Reinecke <hare@suse.de>
> ---
>   man/pvdisplay.8.in | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man/pvdisplay.8.in b/man/pvdisplay.8.in
> index 03c12c4..13c26b5 100644
> --- a/man/pvdisplay.8.in
> +++ b/man/pvdisplay.8.in
> @@ -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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] Handle duplicate PVs on drbd
  2014-03-18  8:24 ` [PATCH 2/2] Handle duplicate PVs on drbd Hannes Reinecke
@ 2014-03-18  9:10   ` Zdenek Kabelac
  0 siblings, 0 replies; 7+ messages in thread
From: Zdenek Kabelac @ 2014-03-18  9:10 UTC (permalink / raw)
  To: lvm-devel

Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
> From: Xinwei Hu <xwhu@suse.de>
>
> If lvm finds a duplicate PV where one device is a drbd device
> it should prefer the drbd device.
>
> Signed-off-by: Xinwei Hu <xwhu@suse.de>
> Acked-by: Hannes Reinecke <hare@suse.de>
> ---
>   lib/cache/lvmcache.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
> index d40bdce..ebc619b 100644
> --- a/lib/cache/lvmcache.c
> +++ b/lib/cache/lvmcache.c
> @@ -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;
> +

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB
  2014-03-18  8:57   ` Zdenek Kabelac
@ 2014-03-18  9:11     ` Hannes Reinecke
  2014-03-18  9:36       ` Zdenek Kabelac
  0 siblings, 1 reply; 7+ messages in thread
From: Hannes Reinecke @ 2014-03-18  9:11 UTC (permalink / raw)
  To: lvm-devel

On 03/18/2014 09:57 AM, Zdenek Kabelac wrote:
> Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
>> From: Thomas Fehr <fehr@suse.de>
>>
>> The size is displayed in sectors, not kilobytes.
>>
>> Signed-off-by: Thomas Fehr <fehr@suse.de>
>> Acked-by: Hannes Reinecke <hare@suse.de>
>> ---
>>   man/pvdisplay.8.in | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/man/pvdisplay.8.in b/man/pvdisplay.8.in
>> index 03c12c4..13c26b5 100644
>> --- a/man/pvdisplay.8.in
>> +++ b/man/pvdisplay.8.in
>> @@ -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
> 
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
-- 
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)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB
  2014-03-18  9:11     ` Hannes Reinecke
@ 2014-03-18  9:36       ` Zdenek Kabelac
  0 siblings, 0 replies; 7+ messages in thread
From: Zdenek Kabelac @ 2014-03-18  9:36 UTC (permalink / raw)
  To: lvm-devel

Dne 18.3.2014 10:11, Hannes Reinecke napsal(a):
> On 03/18/2014 09:57 AM, Zdenek Kabelac wrote:
>> Dne 18.3.2014 09:24, Hannes Reinecke napsal(a):
>>> From: Thomas Fehr <fehr@suse.de>
>>>
>>> The size is displayed in sectors, not kilobytes.
>>>
>>> Signed-off-by: Thomas Fehr <fehr@suse.de>
>>> Acked-by: Hannes Reinecke <hare@suse.de>
>>> ---
>>>    man/pvdisplay.8.in | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/man/pvdisplay.8.in b/man/pvdisplay.8.in
>>> index 03c12c4..13c26b5 100644
>>> --- a/man/pvdisplay.8.in
>>> +++ b/man/pvdisplay.8.in
>>> @@ -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
>>
> 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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-18  9:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18  8:24 [PATCH 0/2] Ancient SUSE patches Hannes Reinecke
2014-03-18  8:24 ` [PATCH 1/2] Fix pvdisplay to refer to sectors, not KB Hannes Reinecke
2014-03-18  8:57   ` Zdenek Kabelac
2014-03-18  9:11     ` Hannes Reinecke
2014-03-18  9:36       ` Zdenek Kabelac
2014-03-18  8:24 ` [PATCH 2/2] Handle duplicate PVs on drbd Hannes Reinecke
2014-03-18  9:10   ` Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.