]> git.baikalelectronics.ru Git - kernel.git/commit
md: fix raid5 'repair' operations
authorDan Williams <dan.j.williams@intel.com>
Mon, 12 May 2008 21:02:12 +0000 (14:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 13 May 2008 15:02:24 +0000 (08:02 -0700)
commitf411d768ea0b445b005c089d7132a2a79a8c2bdf
tree6294b87ebf31d577cd48880a201ff4b1a6a50ffc
parente9120a0abc6ac512f886cff7e1b56ec2a03b6ee9
md: fix raid5 'repair' operations

commit 49834098fd029d609eb6134583aaec1f2995c8e3 "md: close a livelock window
in handle_parity_checks5" introduced a bug in handling 'repair' operations.
After a repair operation completes we clear the state bits tracking this
operation.  However, they are cleared too early and this results in the code
deciding to re-run the parity check operation.  Since we have done the repair
in memory the second check does not find a mismatch and thus does not do a
writeback.

Test results:
$ echo repair > /sys/block/md0/md/sync_action
$ cat /sys/block/md0/md/mismatch_cnt
51072
$ echo repair > /sys/block/md0/md/sync_action
$ cat /sys/block/md0/md/mismatch_cnt
0

(also fix incorrect indentation)

Cc: <stable@kernel.org>
Tested-by: George Spelvin <linux@horizon.com>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/md/raid5.c