md: fix small irregularity with start_ro module parameter
authorNeilBrown <neilb@suse.de>
Wed, 30 Dec 2009 01:08:50 +0000 (12:08 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 28 Jan 2010 23:02:18 +0000 (15:02 -0800)
commit2928b68f6294139ffbd2138440ce08efeaf23d15
tree8c1734f405616bb8d1f3eeea1fde1761ba0e03d8
parent31cf6d8a86469e96cf4ea0a0a89b87ddef1a65cc
md: fix small irregularity with start_ro module parameter

commit 0f9552b5dc4fe10da37fa3f4a4ca185d90fa41c9 upstream.

The start_ro modules parameter can be used to force arrays to be
started in 'auto-readonly' in which they are read-only until the first
write.  This ensures that no resync/recovery happens until something
else writes to the device.  This is important for resume-from-disk
off an md array.

However if an array is started 'readonly' (by writing 'readonly' to
the 'array_state' sysfs attribute) we want it to be really 'readonly',
not 'auto-readonly'.

So strengthen the condition to only set auto-readonly if the
array is not already read-only.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/md.c