Bug 834712

Summary: lvresize, lvresize-free fail unnecessarily if you don't change the size of the LV: "New size (nn extents) matches existing size (nn extents)"
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dyasny, mbooth
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-23 17:22:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test-virt-resize.log none

Description Richard W.M. Jones 2012-06-22 20:46:13 UTC
Created attachment 593825 [details]
test-virt-resize.log

Description of problem:

The virt-resize test failed once in a strange and unexplained way:

  Fatal error: exception Guestfs.Error("lvresize_free: File descriptor 3 (socket:[2499]) leaked on lvm invocation. Parent PID 831: guestfsd
    New size (91 extents) matches existing size (91 extents)
    Run `lvresize --help' for more information.")

(See attached log for complete output)

Version-Release number of selected component (if applicable):

1.19.9

How reproducible:

Only once

Steps to Reproduce:
1. Unknown

Comment 1 Richard W.M. Jones 2012-11-23 16:46:02 UTC
One line reproducer:

$ guestfish -N lv lvresize-free /dev/VG/LV 100
libguestfs: error: lvresize_free:   New size (24 extents) matches existing size (24 extents)
  Run `lvresize --help' for more information.

This is fairly non-useful behaviour of lvresize.  For example,
you can reduce the size of an LV:

$ guestfish -N lv:/dev/VG/LV:1G lvresize /dev/VG/LV 512
[no error]

but you're not allowed to keep the size exactly the same:

$ guestfish -N lv:/dev/VG/LV:1G lvresize /dev/VG/LV 1020
libguestfs: error: lvresize:   New size (255 extents) matches existing size (255 extents)
  Run `lvresize --help' for more information.

which is stupid.  We should catch this case in lvresize and
fix it up.

Comment 2 Richard W.M. Jones 2012-11-23 17:22:41 UTC
Fixed upstream in commit 1ef9af9acbd4cfaadb3f96e0e1a5e519fad2da9d.