Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 266724 - sys-fs/mdadm-2.6.9 init script assumes standard device names
Summary: sys-fs/mdadm-2.6.9 init script assumes standard device names
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-19 05:50 UTC by Sven E.
Modified: 2009-08-23 11:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven E. 2009-04-19 05:50:32 UTC
The mdraid init script addon code from the mdadm package assumes the device names to be in the 'dm standard' format, which is not necessarily true.
It would be better to check the name more thorougly and if necessary let mdadm handle the creation of device inodes.


Reproducible: Always

Steps to Reproduce:
1.Create named array with symbolic device name
2.try starting the init script
3.

Actual Results:  
Varies on exact configuration
Either complete failure:

* Starting up RAID devices...
* /dev/md/tempstorage b 9
mknod: missing operand after `9'
Try `mknod --help' for more information.
* /dev/md/SystemArea b 9
mknod: missing operand after `9'
Try `mknod --help' for more information.
mdadm: /dev/md/tempstorage does not exist and is not a 'standard' name so it cannot be created
mdadm: /dev/md/SystemArea does not exist and is not a 'standard' name so it cannot be created                                      [ !! ]

or if the configuration in mdadm.conf asks mdadm to create the inodes:
* Starting up RAID devices...
* /dev/md/tempstorage b 9
mknod: missing operand after `9'
Try `mknod --help' for more information.
* /dev/md/SystemArea b 9
mknod: missing operand after `9'
Try `mknod --help' for more information.                                                       [ ok ]

Expected Results:  
The array should be set up properly... And no additional mknod output should be printed out.


In the output there are additional einfo lines (I added for debugging) to see what the script actually passes to mknod.

The failing command is:
mknod "${node}" b ${MAJOR} ${node##*[![:digit:]]}

because ${node##*[![:digit:]]} is empty for symbolic names.

Some check should be made here, if ${node##*[![:digit:]]} is empty and the mknod should be skipped.

On the other hand, later on mdadm is called like this:
output=$(mdadm -As 2>&1)

By definition this implies --auto=yes which asks mdadm to create the necessary inodes anyway, for symbolic names --auto=md (etc.) works in an equal way.

Imho, since usually a 'preferred' minor is stored in the superblock, you'd want to let mdadm create the inodes as needed. (And let the user override the --auto flag in the config where appropriate).
Comment 1 SpanKY gentoo-dev 2009-08-23 11:19:42 UTC
in the past, the --auto option didnt actually work, and no one was using non-standard names

ive dropped the device creation from mdadm 3.0