md/raid10: fix two bugs in handling of known-bad-blocks.
authorNeilBrown <neilb@suse.de>
Mon, 13 Jan 2014 23:38:09 +0000 (10:38 +1100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 15 Feb 2014 19:20:16 +0000 (19:20 +0000)
commit11bbcdfc5e8d7983403952f37543d085be5d6f58
tree08b528aa1361029e7aeb7dc4239494bd5fb3e8cb
parent861e3781037f4f7bafe6ae4967bd551157c8fcfc
md/raid10: fix two bugs in handling of known-bad-blocks.

commit b50c259e25d9260b9108dc0c2964c26e5ecbe1c1 upstream.

If we discover a bad block when reading we split the request and
potentially read some of it from a different device.

The code path of this has two bugs in RAID10.
1/ we get a spin_lock with _irq, but unlock without _irq!!
2/ The calculation of 'sectors_handled' is wrong, as can be clearly
   seen by comparison with raid1.c

This leads to at least 2 warnings and a probable crash is a RAID10
ever had known bad blocks.

Fixes: 856e08e23762dfb92ffc68fd0a8d228f9e152160
Reported-by: Damian Nowak <spam@nowaker.net>
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/md/raid10.c