Bug 752156 - mdadm --examine --brief output is inconsistent across metadata versions
Summary: mdadm --examine --brief output is inconsistent across metadata versions
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mdadm
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Doug Ledford
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-08 17:24 UTC by David Lehman
Modified: 2011-11-11 04:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-08 17:42:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Lehman 2011-11-08 17:24:55 UTC
Description of problem:
mdadm --examine --brief shows the metadata version for v1 but not for v0. This is inconsistent and makes it unnecessarily difficult to determine the metadata version of existing v0 arrays that are not currently active.

Version-Release number of selected component (if applicable):
mdadm-3.2.2-13.fc16

How reproducible:
Always

Steps to Reproduce:
1. Deactivate a v0 array
2. Run mdadm --examine --brief on one of its member devices
3.
  
Actual results:
v0: lists array name, UUID
v1: lists array name, UUID, and metadata version

Expected results:
same fields for both so that the command can be used to determine metadata version

Additional info:

Comment 1 David Lehman 2011-11-08 17:29:29 UTC
This broke anaconda's ability to determine metadata version for preexisting v0 arrays, which will prevent people from using them for /boot in F16 (bug 750480). It never occurred to me that the examine/brief output would omit this info for some metadata versions.

Comment 2 Doug Ledford 2011-11-08 17:39:37 UTC
I'm pretty sure Neil did this as a back compatibility thing.  If you were to run mdadm -Eb > mdadm.conf and then try to read that mdadm.conf file with an older mdadm version that didn't know about version 1.x superblock arrays, and we specified an array as having metadata version 0.90, then the older mdadm tool would choke on the file (it would also obviously choke if you had any version 1.x arrays).  Likewise for back compatibility with people's custom scripts, the output of /proc/mdstat does not include the array's version for version 0.90 arrays.  So, even though the default array type we create now is version 1.2, for the output of mdadm -E, mdadm -D, mdadm -Q, and /proc/mdstat, no version means version 0.90, and all other versions will have their version specified.  So the simple answer to your issue is to pre-set the version to 0.90, and only if a version string is present in the output, override the pre-set version.

Comment 3 David Lehman 2011-11-08 19:15:22 UTC
I think that coherent, consistent tools are more important than backward-compatibility, especially when you are talking about being able to run an mdadm.conf generated on a new system using a (very) old version of mdadm. That's useless IMO.

Comment 4 Doug Ledford 2011-11-11 04:12:59 UTC
The tool *is* coherent and consistent, just not in the way that you expected ;-)

Implement what I mentioned in comment #2 and both backward compatibility and consistency are served.  I get that it caught you off guard, that's entirely understandable from someone coming in from the outside that wasn't there when the decision was made to handle things this way, and it's entirely possible that documentation of this behaviour is lacking.  But that doesn't make the behaviour wrong.


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