]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdmon: ignore inactive arrays and other manage_new() cleanups
authorDan Williams <dan.j.williams@intel.com>
Wed, 30 Jul 2008 02:01:06 +0000 (19:01 -0700)
committerDan Williams <dan.j.williams@intel.com>
Mon, 4 Aug 2008 23:48:27 +0000 (16:48 -0700)
commit836759d561453e7777a233122ec6acba8663a180
tree4dd55e3e35e031a5ec693fede27830187dc28f13
parent9ca2c81c0f8bd37ef24e5e3ac898ffb6cfd00117
mdmon: ignore inactive arrays and other manage_new() cleanups

While mdadm is constructing an array mdmon may see an intermediate state
(some disks not yet added / redundancy attributes like sync_action not
available).  Waiting for mdstat->active == true ensures that the array
is ready to be handled.  This fixes a bug in create array via mdmon
update whereby failures are not detected in the new array.

Introduce aa_ready() to catch cases where the active_array is not
correctly initialized.  Barring a kernel bug this should never trigger,
nonetheless it precludes a class of bugs like the one mentioned above
from triggering.

Cleanup the exit paths and only call replace_array when the new array is
ready to be inserted into container->arrays.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
managemon.c