]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: allow creation of mdNNN arrays via md_mod/parameters/new_array
authorNeilBrown <neilb@suse.com>
Wed, 12 Apr 2017 06:26:13 +0000 (16:26 +1000)
committerShaohua Li <shli@fb.com>
Wed, 12 Apr 2017 19:30:11 +0000 (12:30 -0700)
commit039b7225e6e98783a7a7e79c52b29c437f29967d
tree02830472fe5f087223507e3cec16544eef02dbd4
parentfcd403aff643a120dbb3f1851337df5353ac8970
md: allow creation of mdNNN arrays via md_mod/parameters/new_array

The intention when creating the "new_array" parameter and the
possibility of having array names line "md_HOME" was to transition
away from the old way of creating arrays and to eventually only use
this new way.

The "old" way of creating array is to create a device node in /dev
and then open it.  The act of opening creates the array.
This is problematic because sometimes the device node can be opened
when we don't want to create an array.  This can easily happen
when some rule triggered by udev looks at a device as it is being
destroyed.  The node in /dev continues to exist for a short period
after an array is stopped, and opening it during this time recreates
the array (as an inactive array).

Unfortunately no clear plan for the transition was created.  It is now
time to fix that.

This patch allows devices with numeric names, like "md999" to be
created by writing to "new_array".  This will only work if the minor
number given is not already in use.  This will allow mdadm to
support the creation of arrays with numbers > 511 (currently not
possible) by writing to new_array.
mdadm can, at some point, use this approach to create *all* arrays,
which will allow the transition to only using the new-way.

Signed-off-by: NeilBrown <neilb@suse.com>
Acted-by: Coly Li <colyli@suse.de>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.c