]> 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)
commit19cda0f39bf680ef2599c6a7a09f36a1bd90332b
tree48dfb1c192274002fc045996f49915a4d9af3bf8
parentccdae4b967d4c42bd14bea339c7662539201bc80
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