]> git.baikalelectronics.ru Git - kernel.git/commit
md: provide appropriate return value for spare_active functions.
authorNeilBrown <neilb@suse.de>
Wed, 18 Aug 2010 01:56:59 +0000 (11:56 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 18 Aug 2010 02:04:32 +0000 (12:04 +1000)
commit2a81d9b080c0df8df84be87a52277398998383cd
tree9d090d2e363d269cdc55549213025d86af8ef70a
parent75ecf9fc503250c594f116abf875bc5cb36c2a3d
md: provide appropriate return value for spare_active functions.

md_check_recovery expects ->spare_active to return 'true' if any
spares were activated, but none of them do, so the consequent change
in 'degraded' is not notified through sysfs.

So count the number of spares activated, subtract it from 'degraded'
just once, and return it.

Reported-by: Adrian Drzewiecki <adriand@vmware.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c