RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1507996 - vdo create allows creation on block device that is already used by another vdo
Summary: vdo create allows creation on block device that is already used by another vdo
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: vdo
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Sweet Tea Dorminy
QA Contact: Jakub Krysl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-31 16:20 UTC by Jakub Krysl
Modified: 2019-03-06 01:44 UTC (History)
3 users (show)

Fixed In Version: 6.1.0.44
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 15:46:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0871 0 None None None 2018-04-10 15:47:21 UTC

Description Jakub Krysl 2017-10-31 16:20:20 UTC
Description of problem:
There is no check when creating vdo if used block device is already in use. This leads to some really interesting situation when creating another vdo on the same device as already existing vdo is permitted.

# vdo create --device /dev/sdc --name vdo                                        
Creating VDO vdo                                                                                         
Starting VDO vdo                                                                                         
Starting compression on VDO vdo                                                                          
VDO instance 41 volume is ready at /dev/mapper/vdo                                                       
VDO volume created at /dev/mapper/vdo                                                                    
# vdo create --device /dev/sdc --name vdo1                                       
Creating VDO vdo1                                                                                        
Starting VDO vdo1                                                                                        
Starting compression on VDO vdo1                                                                         
VDO instance 42 volume is ready at /dev/mapper/vdo1                                                      
VDO volume created at /dev/mapper/vdo1 

No indication in colsole that anything is wrong at this point.

# mkfs.xfs -K /dev/mapper/vdo                                                                                                                                                              
meta-data=/dev/mapper/vdo        isize=512    agcount=6, agsize=268435455 blks                                                                                                                                     
         =                       sectsz=4096  attr=2, projid32bit=1                                                                                                                                                
         =                       crc=1        finobt=0, sparse=0                                                                                                                                                   
data     =                       bsize=4096   blocks=1465130646, imaxpct=5                                                                                                                                         
         =                       sunit=0      swidth=0 blks                                                                                                                                                        
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1                                                                                                                                                   
log      =internal log           bsize=4096   blocks=521728, version=2                                                                                                                                             
         =                       sectsz=4096  sunit=1 blks, lazy-count=1                                 
realtime =none                   extsz=4096   blocks=0, rtextents=0                                      
# mkfs.xfs -K /dev/mapper/vdo1                                                   
meta-data=/dev/mapper/vdo1       isize=512    agcount=6, agsize=268435455 blks                           
         =                       sectsz=4096  attr=2, projid32bit=1                                      
         =                       crc=1        finobt=0, sparse=0                                         
data     =                       bsize=4096   blocks=1465130646, imaxpct=5                               
         =                       sunit=0      swidth=0 blks                                              
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1                                         
log      =internal log           bsize=4096   blocks=521728, version=2                                   
         =                       sectsz=4096  sunit=1 blks, lazy-count=1                                 
realtime =none                   extsz=4096   blocks=0, rtextents=0                                      

Still no error in console.

# mkdir vdo                                                                      
# mkdir vdo1                                                                     
# mount /dev/mapper/vdo vdo                                                      
mount: /dev/mapper/vdo: can't read superblock                                                            
# mount /dev/mapper/vdo1 vdo1                                                    

And here is console output when trying to mount the 1st vdo "vdo":
[106751.184835] kvdo41:logQ0: Completing read VIO for LBN 1 with error after readData: kvdo: Compressed block fragment is invalid (2073)                                                                           
[106751.196892] kvdo41:cpuQ1: mapToSystemError: mapping internal status code 2073 (kvdo: VDO_INVALID_FRAGMENT: kvdo: Compressed block fragment is invalid) to EIO                                                  
[106751.211285] kvdo41:logQ0: Completing read VIO for LBN 1 with error after readData: kvdo: Compressed block fragment is invalid (2073)                                                                           
[106751.223356] kvdo41:cpuQ1: mapToSystemError: mapping internal status code 2073 (kvdo: VDO_INVALID_FRAGMENT: kvdo: Compressed block fragment is invalid) to EIO                                                  
[106751.237547] Buffer I/O error on dev dm-2, logical block 1, async page read                                                                                                                                     
[106751.245194] kvdo41:logQ0: Completing read VIO for LBN 805306372 with error after readData: kvdo: Compressed block fragment is invalid (2073)                                                                   
[106751.257941] kvdo41:cpuQ0: mapToSystemError: mapping internal status code 2073 (kvdo: VDO_INVALID_FRAGMENT: kvdo: Compressed block fragment is invalid) to EIO                                                  
[106751.272152] XFS (dm-2): metadata I/O error: block 0x180000020 ("xlog_bread_noalign") error 5 numblks 8                                                                                                         
[106751.281546] XFS (dm-2): empty log check failed                                                                                                                                                                 
[106751.286078] XFS (dm-2): log mount/recovery failed: error -5                                                                                                                                                    
[106751.291778] XFS (dm-2): log mount failed  

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

How reproducible:
100%

Steps to Reproduce:
1.vdo create --device /dev/sdc --name vdo
2.vdo create --device /dev/sdc --name vdo1

Actual results:
Both vdos are created, one (maybe both) is corrupted

Expected results:
Second vdo is not created, no curruption

Additional info:

Comment 3 Jakub Krysl 2017-11-14 12:52:52 UTC
vdo-6.1.0.46-9 no longer allows creation of new VDO on the same block device:

# vdo create --device /dev/sda3 --name vdo
Creating VDO vdo
Starting VDO vdo
Starting compression on VDO vdo
VDO instance 5 volume is ready at /dev/mapper/vdo
# vdo create --device /dev/sda3 --name vdo2
Creating VDO vdo2
vdo: ERROR - vdoformat: Cannot format device already containing a valid VDO!

Comment 6 errata-xmlrpc 2018-04-10 15:46:34 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/RHEA-2018:0871


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