Bug 582904

Summary: Parted & partprobe return zero(success) status even under error conditions
Product: Red Hat Enterprise Linux 5 Reporter: Joe Jin <joe.jin>
Component: partedAssignee: Hans de Goede <hdegoede>
Status: CLOSED DUPLICATE QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-04-19 08:35:26 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 Joe Jin 2010-04-16 07:07:37 UTC
Description of problem:

When programed with parted and found below command always return 0
even failed:
# parted /dev/mapper/mpath1 -s -- mklabel msdos mkpart primary 2048s -1s  
device-mapper: remove ioctl failed: Device or resource busy
device-mapper: remove ioctl failed: Device or resource busy
device-mapper: create ioctl failed: Device or resource busy
# echo $?
0  


How reproducible:
  Always as above command.

Steps to Reproduce:
1. Above command.
  
Actual results:


Expected results:
Return no-zero on failed, otherwise return zero.

Additional info:
  Checked source code of parted found in libparted/arch/linux.c, 
  when call dm_ related functions, it always think return value
  <0 if failed, in fact, checked source code of dm_..() functions
  and found it always return 1 on success, error will return 0,
  it's the root cause.

Attach the patch, please review and include it.

Comment 1 Joe Jin 2010-04-16 07:23:10 UTC
Double submitted, please mark it as duplicate issue of 582907.

Comment 2 Hans de Goede 2010-04-19 08:35:26 UTC

*** This bug has been marked as a duplicate of bug 582907 ***