]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
md: remove ability to explicit set an inactive array to 'clean'.
authorNeilBrown <neilb@suse.de>
Thu, 7 May 2009 02:50:57 +0000 (12:50 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 May 2009 23:34:29 +0000 (16:34 -0700)
commit8742775d97caef1ec167c99162c778b25eaefd08
treef7ffd0e280c22ac7f13bb20d95595ef075ebe29b
parent2dedbbdc1986ce130bfa6fe3cf54d2da057e6d5a
md: remove ability to explicit set an inactive array to 'clean'.

commit 5bf295975416f8e97117bbbcfb0191c00bc3e2b4 upstream.

Being able to write 'clean' to an 'array_state' of an inactive array
to activate it in 'clean' mode is both unnecessary and inconvenient.

It is unnecessary because the same can be achieved by writing
'active'.  This activates and array, but it still remains 'clean'
until the first write.

It is inconvenient because writing 'clean' is more often used to
cause an 'active' array to revert to 'clean' mode (thus blocking
any writes until a 'write-pending' is promoted to 'active').

Allowing 'clean' to both activate an array and mark an active array as
clean can lead to races:  One program writes 'clean' to mark the
active array as clean at the same time as another program writes
'inactive' to deactivate (stop) and active array.  Depending on which
writes first, the array could be deactivated and immediately
reactivated which isn't what was desired.

So just disable the use of 'clean' to activate an array.

This avoids a race that can be triggered with mdadm-3.0 and external
metadata, so it suitable for -stable.

Reported-by: Rafal Marszewski <rafal.marszewski@intel.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/md.c