Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1512905

Summary: RFE: Expose corrupted geometry block message to user
Product: Red Hat Enterprise Linux 7 Reporter: Jakub Krysl <jkrysl>
Component: vdoAssignee: Matthew Sakai <msakai>
Status: CLOSED WONTFIX QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: awalsh, bgurney, corwin, jkrysl, limershe, msakai, pasik
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-04 19:21:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jakub Krysl 2017-11-14 12:20:18 UTC
Description of problem:
This is a follow up after BZ 1509466.

Vdo clearly knows the geometry block is corrupted, but user gets "Input/output error". 

# vdo create --device /dev/sda3 --name vdo
Creating VDO vdo
Starting VDO vdo
Starting compression on VDO vdo
VDO instance 0 volume is ready at /dev/mapper/vdo
# vdo stop --name vdo
Stopping VDO vdo
# sudo dd if=/dev/zero of=/dev/sda3 bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.00759499 s, 539 kB/s
# vdo start --name vdo
Starting VDO vdo
vdo: ERROR - Could not set up device mapper for vdo
vdo: ERROR - device-mapper: reload ioctl on vdo  failed: Input/output error

[ 1235.476435] kvdo1:dmsetup: starting device 'vdo' device instantiation 1 (ti=ffffb4e481fd8040) write policy sync                                                                                                 
[ 1235.529034] kvdo1:dmsetup: underlying device, REQ_FLUSH: not supported, REQ_FUA: not supported        
[ 1235.568932] kvdo1:dmsetup: zones: 1 logical, 1 physical, 1 hash; base threads: 5                      
[ 1235.602342] kvdo1:dmsetup: loadVolumeGeometry ID mismatch, expected 5, got 0: kvdo: Component id mismatch in decoder (2059)                                                                                     
[ 1235.652022] kvdo1:dmsetup: Could not create kernel physical layer. (VDO error 2059, message Could not load geometry block)                                                                                      
[ 1235.702528] kvdo1:dmsetup: mapToSystemError: mapping internal status code 2059 (kvdo: VDO_INCORRECT_COMPONENT: kvdo: Component id mismatch in decoder) to EIO                                                   
[ 1235.765716] device-mapper: table: 253:0: dedupe: Could not load geometry block                        
[ 1235.798237] device-mapper: ioctl: error adding target to table

Verified as this no longer leads to kernel oops. Creating new RFE bug for vdo to expose the I/O error reason ("Could not load geometry block") to user.

Version-Release number of selected component (if applicable):
kvdo-6.1.0.46-8
vdo-6.1.0.46-9

How reproducible:
100%

Steps to Reproduce:
1. create vdo
2. stop vdo
3. corrupt UDS superblock (dd if=/dev/zero of=DEVICE bs=4096 count=1) 
4. start vdo

Actual results:
Starting VDO vdo
vdo: ERROR - Could not set up device mapper for vdo
vdo: ERROR - device-mapper: reload ioctl on vdo  failed: Input/output error

Expected results:
Starting VDO vdo
vdo: ERROR - Could not set up device mapper for vdo
vdo: ERROR - device-mapper: table: 253:0: dedupe: Could not load geometry block, geometry block corrupted.

Additional info:

Comment 5 corwin 2018-12-04 19:21:04 UTC
The standard for this situation for lvm is "look in the log," and there is currently no mechanism to do anything better.