md/raid1: fix write behind issues introduced by bio_clone_bioset_partial
authorShaohua Li <shli@fb.com>
Tue, 21 Feb 2017 22:27:57 +0000 (14:27 -0800)
committerShaohua Li <shli@fb.com>
Thu, 23 Feb 2017 19:59:44 +0000 (11:59 -0800)
commit1ec492232ed659acde8cc00b9ecc7529778e03e1
tree5fff4d0691ad377deba45e888e5339708064ba96
parentaff8da09f2381f0869faaf6637b0d892a3ee99ed
md/raid1: fix write behind issues introduced by bio_clone_bioset_partial

There are two issues, introduced by commit 8e58e32(md/raid1: use
bio_clone_bioset_partial() in case of write behind):
- bio_clone_bioset_partial() uses bytes instead of sectors as parameters
- in writebehind mode, we return bio if all !writemostly disk bios finish,
  which could happen before writemostly disk bios run. So all
  writemostly disk bios should have their bvec. Here we just make sure
  all bios are cloned instead of fast cloned.

Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid1.c