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.
Double submitted, please mark it as duplicate issue of 582907.
*** This bug has been marked as a duplicate of bug 582907 ***