Bug 582904 - Parted & partprobe return zero(success) status even under error conditions
Summary: Parted & partprobe return zero(success) status even under error conditions
Keywords:
Status: CLOSED DUPLICATE of bug 582907
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: parted
Version: 5.5
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Hans de Goede
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-16 07:07 UTC by Joe Jin
Modified: 2010-04-19 08:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-19 08:35:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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 ***


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