]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid10: fix two problems with RAID10 resync.
authorNeilBrown <neilb@suse.de>
Tue, 16 Jul 2013 06:50:47 +0000 (16:50 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 18 Jul 2013 04:18:01 +0000 (14:18 +1000)
commit193c0b2949b9322f8024dd0b4b50f0d833e1cee1
treee457c9dc9bfbc502f8a739749a6d6d287f2ec144
parenta802d7f8459eee28f7b11d7dee7ac6e333bff61e
md/raid10: fix two problems with RAID10 resync.

1/ When an different between blocks is found, data is copied from
   one bio to the other.  However bv_len is used as the length to
   copy and this could be zero.  So use r10_bio->sectors to calculate
   length instead.
   Using bv_len was probably always a bit dubious, but the introduction
   of bio_advance made it much more likely to be a problem.

2/ When preparing some blocks for sync, we don't set BIO_UPTODATE
   except on bios that we schedule for a read.  This ensures that
   missing/failed devices don't confuse the loop at the top of
   sync_request write.
   Commit d43c0c58c242828 "raid10: Use bio_reset()"
   removed a loop which set BIO_UPTDATE on all appropriate bios.
   So we need to re-add that flag.

These bugs were introduced in 3.10, so this patch is suitable for
3.10-stable, and can remove a potential for data corruption.

Cc: stable@vger.kernel.org (3.10)
Reported-by: Brassow Jonathan <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c