Bug 187273 - If dmsetup create is given a table that fails to load, remove the new device transparently
Summary: If dmsetup create is given a table that fails to load, remove the new device ...
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: device-mapper   
(Show other bugs)
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Alasdair Kergon
QA Contact:
Depends On:
Blocks: 181409 185483
TreeView+ depends on / blocked
Reported: 2006-03-29 18:16 UTC by Issue Tracker
Modified: 2010-01-12 02:15 UTC (History)
6 users (show)

Fixed In Version: RHBA-2006-0434
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-10 21:24:06 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch submitted by IBM (622 bytes, patch)
2006-03-29 18:22 UTC, Jeff Layton
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0434 normal SHIPPED_LIVE device-mapper bug fix and enhancement update 2006-08-09 04:00:00 UTC

Comment 4 Jeff Layton 2006-03-29 18:20:45 UTC
Short synopsis for engineering...

When a dmsetup create fails with an invalid argument (and maybe in other
sitations as well), the device is still created in an inconsistent state:

[root@pe4600 ~]# echo "0 14424288 linear /dev/sdc1 -1" | dmsetup create hugo
device-mapper: reload ioctl failed: Invalid argument
Command failed
[root@pe4600 ~]# dmsetup info
Name:              hugo
State:             ACTIVE
Tables present:    None
Open count:        0
Event number:      0
Major, minor:      253, 0
Number of targets: 0

I've replicated this behavior here. The patch submitted by IBM seems to correct
the problem.

Comment 5 Jeff Layton 2006-03-29 18:22:27 UTC
Created attachment 127010 [details]
patch submitted by IBM

This patch was submitted by IBM and seems to correct the problem.

Comment 7 Alasdair Kergon 2006-03-29 18:58:35 UTC
With version 4 of the ioctl interface (the current version), 'dmsetup create'
with a table supplied is a shortcut for 'dmsetup create --notable' followed by
'dmsetup load' using the table.  This is handled transparently within
libdevmapper and helps to make version 4 compatible with version 1.

The proposal here is to extend that shortcut such that if the load fails, a
dmsetup remove is issued.

The patch is unsatisfactory as it stands because it attempts an unnecessary
remove if the DM_DEVICE_CREATE fails.  The removal should be handled within
libdevmapper itself.  I can't think of any code relying on the existing failure
mode, so I think it is a reasonable thing to change.

[Even after this change of course, scripts that care about error handling are
better off doing dmsetup create --notable followed by dmsetup load.]

Comment 8 Alasdair Kergon 2006-03-29 19:18:38 UTC
Actually, it breaks down into 3 steps, not 2: create, load, resume.

Comment 9 Alasdair Kergon 2006-03-30 15:17:37 UTC
Changed upstream.

Comment 12 Alasdair Kergon 2006-03-30 18:51:28 UTC
in 1.02.04 upstream

Comment 17 Red Hat Bugzilla 2006-08-10 21:24:07 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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