Bug 1597890

Summary: vdo growPhysical of a volume resized offline reports new physical block count as old physical block count
Product: Red Hat Enterprise Linux 7 Reporter: Bryan Gurney <bgurney>
Component: kmod-kvdoAssignee: Matthew Sakai <msakai>
Status: CLOSED ERRATA QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: awalsh, jkrysl
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 6.1.1.107 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 09:39:49 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:

Description Bryan Gurney 2018-07-03 20:24:41 UTC
Description of problem:
If a VDO volume is stopped, and has its backing device resized offline, the message for the physical block count change will print what should be "Physical block count was <old_size>, now <new_size>", but it was discovered in BZ 1582647 that the message now prints as "Physical block count was <new_size>, now <new_size>".

(This does not occur with a backing device that is resized offline)

Version-Release number of selected component (if applicable):
kmod-kvdo-6.1.1.99-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create a partition on a test device, with ample space for resizing (I used a 50 GiB partition).
2. Create a VDO volume on the test partition.
3. Stop the VDO volume with the "vdo stop" command.
4. Grow the device.
5. Start the VDO volume with the "vdo start" command.
6. Execute a "vdo growPhysical" command.



Actual results:
The growPhysical command executes successfully, but the message printed has an "old size" listed with the value of the new size.

Example: "kvdo7:dmsetup: Physical block count was 26214144, now 26214144"


Expected results:
The growPhysical command executed successfully, and the message indicates the previous physical block count, and the new physical block count after the growPhysical operation.

Example: "kvdo7:dmsetup: Physical block count was 13106944, now 26214144"


Additional info:

Demonstration on a test system:

[root@localhost ~]# parted /dev/nvme0n1 mkpart pri 1MiB 50GiB     
Information: You may need to update /etc/fstab.

[root@localhost ~]# vdo create --name=vdo1 --device=/dev/nvme0n1p1
Creating VDO vdo1
Starting VDO vdo1
Starting compression on VDO vdo1
VDO instance 6 volume is ready at /dev/mapper/vdo1
[root@localhost ~]# vdostats vdo1 --verbose | grep hysical\ blocks
  physical blocks                     : 13106944
[root@localhost ~]# vdo stop --name=vdo1
Stopping VDO vdo1
[root@localhost ~]# parted /dev/nvme0n1 resizepart 1 100GiB
Information: You may need to update /etc/fstab.

[root@localhost ~]# vdo start --name=vdo1                                 
Starting VDO vdo1
Starting compression on VDO vdo1
VDO instance 7 volume is ready at /dev/mapper/vdo1
[root@localhost ~]# vdostats vdo1 --verbose | grep hysical\ blocks
  physical blocks                     : 13106944
[root@localhost ~]# date; vdo growPhysical --name=vdo1
Tue Jul  3 16:10:40 EDT 2018
[root@localhost ~]# vdostats vdo1 --verbose | grep hysical\ blocks
  physical blocks                     : 26214144

Jul  3 16:10:40 localhost kernel: kvdo7:dmsetup: Preparing to resize physical to 26214144
Jul  3 16:10:40 localhost kernel: kvdo7:dmsetup: Done preparing to resize physical
Jul  3 16:10:40 localhost kernel: kvdo7:dmsetup: suspending device 'vdo1'
Jul  3 16:10:40 localhost kernel: kvdo7:dmsetup: device 'vdo1' suspended
Jul  3 16:10:40 localhost kernel: kvdo7:dmsetup: Physical block count was 26214144, now 26214144
Jul  3 16:10:40 localhost kernel: kvdo7:dmsetup: resuming device 'vdo1'
Jul  3 16:10:40 localhost kernel: kvdo7:dmsetup: device 'vdo1' resumed

Comment 2 Jakub Krysl 2018-07-04 06:52:47 UTC
Thanks Bryan for creating the BZ, less work for me. :)
I wanted to create it when I am sure the parent BZ 1582647 does not cause any regressions so it can go in. If any regressions are found, that fix might be completely different and this BZ might not be needed at all.

Comment 4 Jakub Krysl 2018-07-18 11:02:47 UTC
# vdostats vdo --verbose | grep hysical\ blocks
  physical blocks                     : 13106944
# vdo growPhysical --name=vdo --verbose
    dmsetup status vdo
    dmsetup message vdo 0 prepareToGrowPhysical
    vdodmeventd -u vdo
    dmsetup suspend vdo
    dmsetup message vdo 0 growPhysical
    vdodumpconfig /dev/disk/by-id/scsi-3600140550ade793f6124ab5b420f3c20-part1
    dmsetup resume vdo
    vdodmeventd -r vdo
# vdostats vdo --verbose | grep hysical\ blocks
  physical blocks                     : 18349824

/var/log/messages:
[165564.457326] kvdo83:dmsetup: Preparing to resize physical to 18349824
[165564.493024] kvdo83:dmsetup: Done preparing to resize physical
[165564.530973] kvdo83:dmsetup: suspending device 'vdo'
[165564.554436] kvdo83:dmsetup: device 'vdo' suspended
[165564.829926] kvdo83:dmsetup: Physical block count was 13106944, now 18349824
[165564.874701] kvdo83:dmsetup: resuming device 'vdo'
[165564.896901] kvdo83:dmsetup: device 'vdo' resumed

Comment 6 errata-xmlrpc 2018-10-30 09:39:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3094