Mdadm: external metadata arrays and containers are removed incorrectly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mdadm (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* The response to device fails so far was to remove underlying
containers. That failed if the device itself was not stopped
before doing so causing issues.
* Fix by backporting upstream fix
[Test Case]
* This needs a Intel(R) Matrix Storage Hardware which limits the
systems this can be tested.
1. Create IMSM Container:
mdadm -CR imsm0 -e imsm -n 2 /dev/sd[bc]
2. Create IMSM level 0 Array:
mdadm -CR vol0 -l 0 -n 2 /dev/sd[bc]
3. Wait for resync to complete
mdadm --wait /dev/md/vol0
4. Read /proc/mdstat and check /dev/md/ directory
cat /proc/mdstat
ls /dev/md/
5. Fail one disk incrementaly (simulate device disappearing
from system)
mdadm -If sdc
6. Check mdstat file and /dev/md/
cat /proc/mdstat
ls /dev/md/
Result:
After disk fail [5] raid 0 array should disappear from mdstat,
link /dev/md/imsm0 should exist.
* these should allow someone who is not familiar with the affected
package to reproduce the bug and verify that the updated package fixes
the problem.
[Regression Potential]
* The patch changes the behavior on removing devices. So in that use-case
lies the potential to regress somebody.
It adds stopping the device before removing the containers associated
to it (that is the fix). OTOH if there are cases where the kernel
signals a device fail it would formerly not have removed it (the bug)
but there are (very low) chances that somebody relies on that behavior.
Since this avoids I/O errors on partially removed device elements I'd
expect taking the change makes it better overall.
[Other Info]
* n/a
---
Steps to reproduce:
1. Create IMSM container on 2 SATA disks.
2. Create R0 IMSM volume
3. Wait for resync to complete.
4. Fail one of disks
Expected result:
R0 Array should disappear form /proc/mdstat.
Actual result:
R0 array is visible in mdstat, link to container in /dev/md/ is removed.
Related branches
- Andreas Hasenack: Approve
- Canonical Server: Pending requested
- Canonical Server packageset reviewers: Pending requested
-
Diff: 227 lines (+199/-0)4 files modifieddebian/changelog (+9/-0)
debian/patches/lp-1811228-imsm-Block-volume-creation-with-empty-name.patch (+50/-0)
debian/patches/lp-1811795-remove-external-arrays-and-devices.patch (+138/-0)
debian/patches/series (+2/-0)
- Andreas Hasenack: Approve
- Canonical Server: Pending requested
- Canonical Server packageset reviewers: Pending requested
-
Diff: 227 lines (+199/-0)4 files modifieddebian/changelog (+9/-0)
debian/patches/lp-1811228-imsm-Block-volume-creation-with-empty-name.patch (+50/-0)
debian/patches/lp-1811795-remove-external-arrays-and-devices.patch (+138/-0)
debian/patches/series (+2/-0)
information type: | Private → Public |
Fixed in upstream: /git.kernel. org/pub/ scm/utils/ mdadm/mdadm. git/commit/ ?id=cb8f5371352 f6c16af5aab8a40 861e13aa50fc2b
https:/
Fix is included in mdadm 4.1, please update mdadm package.
Thanks,
Mariusz