Bug 923788

Summary: Cannot remove MD RAID array
Product: [Fedora] Fedora Reporter: Jan Safranek <jsafrane>
Component: python-blivetAssignee: David Lehman <dlehman>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: anaconda-maint-list, bcl, dlehman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: anaconda-19.24-1.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-22 03:12:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
reproducer
none
experimental patch none

Description Jan Safranek 2013-03-20 12:52:03 UTC
Created attachment 713221 [details]
reproducer

If I remove MD RAID array using attached reproducer, I get a traceback:

  File "/mnt/home/project/blivet/examples/delete-raid.py", line 47, in <module>
    storage.devicetree.processActions(dryRun=False)
  File "/usr/lib/python2.7/site-packages/blivet/devicetree.py", line 211, in processActions
    action.device.preCommitFixup(mountpoints=mpoints)
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 3097, in preCommitFixup
    if self.size < 1000 or self.format.type == "swap":
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 2782, in size
    if not self.exists or not self.partedDevice:
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 584, in partedDevice
    if self.exists and self.status and not self._partedDevice:
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 3006, in status
    state = open(state_file).read().strip()
IOError: [Errno 16] Device or resource busy

The reason is:
1) storage.devicetree.registerAction(action) actually stops the MD RAID (shouldn't it be stopped in processActions()???)
2) storage.devicetree.processActions reads its /sys/block/md0/md/array_state, which still exists (even though the MD RAID is already stopped?!), but returns 'Device or resource busy' upon reading.

Comment 1 Jan Safranek 2013-03-20 12:54:13 UTC
Usage of the reproducer:

python delete-raid.py /dev/sdb1 /dev/sdb2

It creates new MD raid with $* (/dev/sdb1 + /dev/sdb2) and then deletes it. Log is in /tmp/blivet.log.

Comment 2 Jan Safranek 2013-03-20 13:04:40 UTC
Created attachment 713233 [details]
experimental patch

Comment 3 Fedora Update System 2013-05-03 23:04:58 UTC
anaconda-19.24-1.fc19, python-blivet-0.12-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-blivet-0.12-1.fc19,anaconda-19.24-1.fc19

Comment 4 Fedora Update System 2013-05-04 18:51:21 UTC
Package anaconda-19.24-1.fc19, python-blivet-0.12-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing anaconda-19.24-1.fc19 python-blivet-0.12-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-7403/python-blivet-0.12-1.fc19,anaconda-19.24-1.fc19
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-05-22 03:12:39 UTC
anaconda-19.24-1.fc19, python-blivet-0.12-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.