Bug 1286648 - Negative size differences incorrectly parsed
Negative size differences incorrectly parsed
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: LVM and device-mapper development team
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-30 07:08 EST by Vratislav Podzimek
Modified: 2015-11-30 12:02 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-30 07:45:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vratislav Podzimek 2015-11-30 07:08:11 EST
Description of problem:
When running e.g. 'lvresize' with something like -L-88M, the negative size difference is incorrectly parsed and the LV is made 8M smaller instead of 88M. The same applies to things like '-l-25'.

Version-Release number of selected component (if applicable):
lvm2-2.02.132-2.fc23.x86_64

How reproducible:
100 %

Steps to Reproduce:
1. have an LV
2. run 'lvresize -L-88M vg/theLV'

Actual results:
theLV made 8M smaller

Expected results:
theLV made 88M smaller

Additional info:
This is a copy of my shell session:
[root@localhost koki]# lvs
  LV              VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data_lv         data   -wi-a-----   1.13t
  safe            data   -wi-ao---- 500.00g
  scratch         data   -wi-a----- 430.88g
  home            system Vwi-aotz--  45.00g pool        64.83
  pool            system twi-aotz--  73.00g             57.22  2.28
  root            system Vwi-aotz--  30.00g pool        41.31
  root_pre_update system Vwi---tz-k  30.00g pool root
[root@localhost koki]# lvchange -an data/scratch
[root@localhost koki]# lvresize -L-88M data/scratch
  Size of logical volume data/scratch changed from 430.88 GiB (110306 extents) to 430.80 GiB (110284 extents).
  Logical volume scratch successfully resized.
[root@localhost koki]# lvs
  LV              VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data_lv         data   -wi-a-----   1.13t
  safe            data   -wi-ao---- 500.00g
  scratch         data   -wi------- 430.80g
  home            system Vwi-aotz--  45.00g pool        64.83
  pool            system twi-aotz--  73.00g             57.22  2.28
  root            system Vwi-aotz--  30.00g pool        41.31
  root_pre_update system Vwi---tz-k  30.00g pool root
Comment 1 Zdenek Kabelac 2015-11-30 07:45:13 EST
As long  as  1GB has 1024MB (and not 100 as you probably expect) - I do not see nothing wrong when  reducing ~880MB to ~800MB

You could use --units M - to see size better.
Comment 2 Vratislav Podzimek 2015-11-30 11:34:59 EST
Oooops, I got confused by the output. Sorry for the noise.
Comment 3 Zdenek Kabelac 2015-11-30 12:02:53 EST
It's probably worth to add:

Far better here would be to specify -L430G - since then you know 'exactly' what is going to be the final size.

Using -+ based on rounded decimal point output will never work precisely.

Note You need to log in before you can comment on or make changes to this bug.