All of lore.kernel.org
 help / color / mirror / Atom feed
* liblvm2app stripe_size reported wrong
@ 2012-07-04 20:20 ben
  2012-07-04 20:26 ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: ben @ 2012-07-04 20:20 UTC (permalink / raw)
  To: lvm-devel

Using Debian liblvm2app2.2:amd64   version 2.02.95-4 the size of stripes on 
segments is reported incorrectly from the library function. The number of 
bytes is divided by 512, which I assume is sectors.

Thank you.





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

* liblvm2app stripe_size reported wrong
  2012-07-04 20:20 liblvm2app stripe_size reported wrong ben
@ 2012-07-04 20:26 ` Alasdair G Kergon
  2012-07-04 20:41   ` ben
  0 siblings, 1 reply; 6+ messages in thread
From: Alasdair G Kergon @ 2012-07-04 20:26 UTC (permalink / raw)
  To: lvm-devel

On Wed, Jul 04, 2012 at 01:20:24PM -0700, ben wrote:
> Using Debian liblvm2app2.2:amd64   version 2.02.95-4 the size of stripes on 
> segments is reported incorrectly from the library function. The number of 
> bytes is divided by 512, which I assume is sectors.
 
Please be specific.
Which function?
What value does it give you?
What should it give you?
What does the output of 'lvs' show?

Alasdair



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

* liblvm2app stripe_size reported wrong
  2012-07-04 20:26 ` Alasdair G Kergon
@ 2012-07-04 20:41   ` ben
  2012-07-04 20:53     ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: ben @ 2012-07-04 20:41 UTC (permalink / raw)
  To: lvm-devel

On Wednesday, July 04, 2012 1:26:06 PM Alasdair G Kergon wrote:
> On Wed, Jul 04, 2012 at 01:20:24PM -0700, ben wrote:
> > Using Debian liblvm2app2.2:amd64   version 2.02.95-4 the size of stripes
> > on segments is reported incorrectly from the library function. The
> > number of bytes is divided by 512, which I assume is sectors.
> 
> Please be specific.
> Which function?
> What value does it give you?
> What should it give you?
> What does the output of 'lvs' show?
> 
> Alasdair
> 
> --
> lvm-devel mailing list
> lvm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/lvm-devel

I am using:

    value = lvm_lvseg_get_property(lvm_lvseg, "stripesize");
    if (value.is_valid)
          segment->stripe_size = value.value.integer; 
   /* now  value.value.integer == 128 */

lvs -o+stripesize
  LV    VG   Attr     LSize Pool Origin Data%  Move Log Copy%  Convert Stripe
  lvol0 vg1  -wi-a--- 1.00g                                            64.00k

Thank you.



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

* liblvm2app stripe_size reported wrong
  2012-07-04 20:41   ` ben
@ 2012-07-04 20:53     ` Alasdair G Kergon
  2012-07-04 21:01       ` ben
  0 siblings, 1 reply; 6+ messages in thread
From: Alasdair G Kergon @ 2012-07-04 20:53 UTC (permalink / raw)
  To: lvm-devel

On Wed, Jul 04, 2012 at 01:41:29PM -0700, ben wrote:
> I am using:
>     value = lvm_lvseg_get_property(lvm_lvseg, "stripesize");
>     if (value.is_valid)
>           segment->stripe_size = value.value.integer; 
>    /* now  value.value.integer == 128 */
> lvs -o+stripesize
>   LV    VG   Attr     LSize Pool Origin Data%  Move Log Copy%  Convert Stripe
>   lvol0 vg1  -wi-a--- 1.00g                                            64.00k
 
Well this field is stored in sectors internally, so it's probably just
returning that value directly.

Whether it should be converting or not, I don't know.
This doesn't seem to be documented and so we'll need to look at how other
fields are handled to see if there's a consistent 'rule' here or not.

Alasdair



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

* liblvm2app stripe_size reported wrong
  2012-07-04 20:53     ` Alasdair G Kergon
@ 2012-07-04 21:01       ` ben
  2012-07-04 21:34         ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: ben @ 2012-07-04 21:01 UTC (permalink / raw)
  To: lvm-devel

On Wednesday, July 04, 2012 1:53:01 PM Alasdair G Kergon wrote:
 
> Well this field is stored in sectors internally, so it's probably just
> returning that value directly.
> 
> Whether it should be converting or not, I don't know.
> This doesn't seem to be documented and so we'll need to look at how other
> fields are handled to see if there's a consistent 'rule' here or not.
> 
> Alasdair

Sector size is changing to a mix of 512 and 4k which will add to the confusion 
if it reports sectors.




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

* liblvm2app stripe_size reported wrong
  2012-07-04 21:01       ` ben
@ 2012-07-04 21:34         ` Alasdair G Kergon
  0 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2012-07-04 21:34 UTC (permalink / raw)
  To: lvm-devel

On Wed, Jul 04, 2012 at 02:01:36PM -0700, ben wrote:
> Sector size is changing to a mix of 512 and 4k which will add to the confusion 
> if it reports sectors.

Like in the kernel, we have a convention that sectors are always treated as 512
bytes.
 
commit 0bc382eae4cf77bdec9e5a2fdb11c72db64438bb
Author: Petr Rockai <prockai@redhat.com>
Date:   Thu Nov 25 14:39:02 2010 +0000

    All 'size' values of lvm2app properties should be in bytes.
    Fix 'seg_size' to return bytes.
    
    Signed-off-by: Dave Wysochanski <wysochanski@pobox.com>
    Reviewed-by: Petr Rockai <prockai@redhat.com>


But if the assertion that all size values should be in bytes is true, why
did that patch only change one field and not these others?

Alasdair



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

end of thread, other threads:[~2012-07-04 21:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-04 20:20 liblvm2app stripe_size reported wrong ben
2012-07-04 20:26 ` Alasdair G Kergon
2012-07-04 20:41   ` ben
2012-07-04 20:53     ` Alasdair G Kergon
2012-07-04 21:01       ` ben
2012-07-04 21:34         ` Alasdair G Kergon

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.