Bug 479006

Summary: device-mapper should check for maximal volume name length
Product: [Fedora] Fedora Reporter: Milan Broz <mbroz>
Component: device-mapper-obsoleteAssignee: Peter Rajnoha <prajnoha>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: agk, bmarzins, dwysocha, heinzm, lvm-team, mbroz, prockai, pvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.02.48-1.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-19 10:32:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milan Broz 2009-01-06 13:33:28 UTC
dmsetup ignores part of provided volume name length quietly

# dmsetup create 012345678901234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456andthisisignored --table "0 1 error"

# dmsetup table
0123456789012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456: 0 1 error

The same check is needed for rename (there is even bug in kernel which allows longer string, then you must address device by using major:minor)
[I sent kernel patch just few minutes ago, but userpsce need to be fixed too]

# dmsetup rename 0123456789012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456 012345678901234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456andthisisignored
Unable to rename device node from '0123456789012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456' to '012345678901234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456andthisisignored'

(the above command should fail in commandline paramaters validation)

# dmsetup table
device-mapper: table ioctl failed: No such device or address
Command failed

(situation above this is just demonstration of kernel bug, there is device with longer name in kernel than ioctl allows to address)

# dmsetup table -j 253 -m 0
0 1 error

- all device-mapper related commands should check for DM_NAME_LEN (it includes trailing zero.

Comment 1 Peter Rajnoha 2009-01-07 12:47:33 UTC
Check for name length has been added as well as check for incorrect names containing '/' character in "dmsetup create" and "dmsetup rename" (the device does not exist in filesystem yet, so entering the path is not allowed).

The fix has been uploaded to upstream CVS (DM version 1.02.30).

Comment 2 Bug Zapper 2009-06-09 10:36:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Fedora Update System 2009-07-03 09:30:07 UTC
lvm2-2.02.48-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/lvm2-2.02.48-1.fc11

Comment 4 Fedora Update System 2009-07-11 17:15:53 UTC
lvm2-2.02.48-1.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update lvm2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-7468

Comment 5 Fedora Update System 2009-07-19 10:31:28 UTC
lvm2-2.02.48-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.