Bug 956053

Summary: mdadm: first stop command cannot stop container during volume's reshape
Product: [Fedora] Fedora Reporter: Lukasz Dorau <lukasz.dorau>
Component: mdadmAssignee: Jes Sorensen <Jes.Sorensen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 18CC: agk, dledford, Jes.Sorensen, maciej.patelczyk, pawel.baldysiak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: mdadm-3.2.6-21.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-06 05:21: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:

Description Lukasz Dorau 2013-04-24 08:50:31 UTC
Description of problem:
First stop command (mdadm -Ss) cannot stop container during volume's reshape.
Stopping for the second time works.

How reproducible:
Always

Steps to Reproduce:
1. Create container and volume:
# mdadm -CR /dev/md/imsm -e imsm -n3 /dev/sda /dev/sdc /dev/sdd
# mdadm -CR /dev/md/vol -l0 -n2 /dev/sda /dev/sdc

2. Run OLCE:
# export MDADM_EXPERIMENTAL=1
# mdadm -G /dev/md127 -n3

3. Stop all RAID devices
# mdadm -Ss
  
Actual results:
Volume is stopped, but container not. 
Output:
# mdadm -Ss
mdadm: stopped /dev/md126
mdadm: Cannot get exclusive access to /dev/md127:Perhaps a running process,
mounted filesystem or active volume group?
mdadm: Cannot get exclusive access to /dev/md127:Perhaps a running process,
mounted filesystem or active volume group?
mdadm: Cannot get exclusive access to /dev/md127:Perhaps a running process,
mounted filesystem or active volume group?

After next stop command container is stopped correctly:
mdadm -Ss
mdadm: stopped /dev/md126
mdadm: stopped /dev/md127


Expected results:
Volume and container are stopped:
mdadm: stopped /dev/md126
mdadm: stopped /dev/md127


Additional info:
This bug is fixed by the following upstream patch:

commit 2fdf559d74a48806900b63f1b4504a18dec048a9
Manage_runstop: call flush_mdmon if O_EXCL fails on stopping mdmon array.
http://git.neil.brown.name/git?p=mdadm.git;a=commit;h=2fdf559d74a48806900b63f1b4504a18dec048a9

Comment 1 Lukasz Dorau 2013-04-25 15:06:10 UTC
After having done more tests it's turned out that the patch doesn't work well and should be corrected. I will let you know when the correct patch will be ready.

Comment 2 Fedora Update System 2013-08-14 11:00:15 UTC
mdadm-3.2.6-21.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mdadm-3.2.6-21.fc18

Comment 3 Fedora Update System 2013-08-15 02:34:11 UTC
Package mdadm-3.2.6-21.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mdadm-3.2.6-21.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-14695/mdadm-3.2.6-21.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-09-06 05:21:39 UTC
mdadm-3.2.6-21.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.