]> git.baikalelectronics.ru Git - kernel.git/commit
md: Fix some bugs in recovery_disabled handling.
authorNeilBrown <neilb@suse.de>
Wed, 26 Oct 2011 00:54:39 +0000 (11:54 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 26 Oct 2011 00:54:39 +0000 (11:54 +1100)
commit1c65746f11402742ef77ee340b6049a835b47834
tree48dfb1c192274002fc045996f49915a4d9af3bf8
parentebfb024b74308aa493df4a890d512263cfce4ada
md: Fix some bugs in recovery_disabled handling.

In 3.0 we changed the way recovery_disabled was handle so that instead
of testing against zero, we test an mddev-> value against a conf->
value.
Two problems:
  1/ one place in raid1 was missed and still sets to '1'.
  2/ We didn't explicitly set the conf-> value at array creation
     time.
     It defaulted to '0' just like the mddev value does so they
     could appear equal and thus disable recovery.
     This did not affect normal 'md' as it calls bind_rdev_to_array
     which changes the mddev value.  However the dmraid interface
     doesn't call this and so doesn't change ->recovery_disabled; so at
     array start all recovery is incorrectly disabled.

So initialise the 'conf' value to one less that the mddev value, so
the will only be the same when explicitly set that way.

Reported-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c