Skip to content
Commit 30bc9b53 authored by NeilBrown's avatar NeilBrown
Browse files

md/raid1: fix bio handling problems in process_checks()



Recent change to use bio_copy_data() in raid1 when repairing
an array is faulty.

The underlying may have changed the bio in various ways using
bio_advance and these need to be undone not just for the 'sbio' which
is being copied to, but also the 'pbio' (primary) which is being
copied from.

So perform the reset on all bios that were read from and do it early.

This also ensure that the sbio->bi_io_vec[j].bv_len passed to
memcmp is correct.

This fixes a crash during a 'check' of a RAID1 array.  The crash was
introduced in 3.10 so this is suitable for 3.10-stable.

Cc: stable@vger.kernel.org (3.10)
Reported-by: default avatarJoe Lawrence <joe.lawrence@stratus.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 5024c298
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment