Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 582907 - [RHEL-5] Parted & partprobe return zero(success) status even under error conditions
[RHEL-5] Parted & partprobe return zero(success) status even under error cond...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: parted (Show other bugs)
5.5
All Linux
low Severity medium
: rc
: ---
Assigned To: Brian Lane
Release Test Team
:
: 582904 (view as bug list)
Depends On:
Blocks: 726828 585158
  Show dependency treegraph
 
Reported: 2010-04-16 03:09 EDT by Joe Jin
Modified: 2012-02-21 00:43 EST (History)
4 users (show)

See Also:
Fixed In Version: parted-1.8.1-29
Doc Type: Bug Fix
Doc Text:
Prior to this update, the parted utility did not handle the return value of the dm_task_run() call correctly on device-mapper devices. As a consequence, parted returned a 0 exit status even if an error occurred. The utility has been modified and now correctly returns 1 if an error occurs.
Story Points: ---
Clone Of:
: 585158 (view as bug list)
Environment:
Last Closed: 2012-02-21 00:43:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fixed parted did not handle the return value of dm_task_run() correctly (1.61 KB, patch)
2010-04-16 03:09 EDT, Joe Jin
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0192 normal SHIPPED_LIVE parted bug fix update 2012-02-20 09:54:22 EST

  None (edit)
Description Joe Jin 2010-04-16 03:09:53 EDT
Created attachment 407012 [details]
Fixed parted did not handle the return value of dm_task_run() correctly

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 Hans de Goede 2010-04-16 08:56:40 EDT
Hi,

Thanks for the bug report and the patch. I've contacted the lvm devs to clarify the return code meaning of dm_task_run. I'll get back to you when I have an answer from then.

Regards,

Hans
Comment 2 Hans de Goede 2010-04-19 04:35:26 EDT
*** Bug 582904 has been marked as a duplicate of this bug. ***
Comment 3 Hans de Goede 2010-04-23 07:29:48 EDT
I've a patch ready for fixing this.
Comment 4 David Cantrell 2010-07-01 21:14:36 EDT
Moving to 5.7 proposed list since parted did not make the approved component list for 5.6.
Comment 6 RHEL Product and Program Management 2011-01-11 15:50:57 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 7 RHEL Product and Program Management 2011-01-11 18:20:43 EST
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.
Comment 8 Brian Lane 2011-02-21 17:15:25 EST
Moving to 5.8 since we have a reasonably low impact patch for this.
Comment 9 RHEL Product and Program Management 2011-08-05 08:30:07 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 10 Eliska Slobodova 2011-09-20 08:39:49 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, the parted utility did not handle the return value of the dm_task_run() call correctly on device-mapper devices. As a consequence, parted returned a 0 exit status even if an error occurred. The utility has been modified and now correctly returns 1 if an error occurs.
Comment 12 Alexander Todorov 2011-12-14 09:50:27 EST
Patch is present and applied in parted-1.8.1-29.el5.src.rpm
Comment 13 errata-xmlrpc 2012-02-21 00:43:15 EST
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.

http://rhn.redhat.com/errata/RHBA-2012-0192.html

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