提交 ab7a30c7 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[PATCH] md: fix bug when raid1 attempts a partial reconstruct.

The logic here is wrong.  if fullsync is 0, it WILL BUG.
Signed-off-by: NNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 191ea9b2
...@@ -1237,13 +1237,16 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -1237,13 +1237,16 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
len = (max_sector - sector_nr) << 9; len = (max_sector - sector_nr) << 9;
if (len == 0) if (len == 0)
break; break;
if (!conf->fullsync && sync_blocks == 0) if (!conf->fullsync) {
if (!bitmap_start_sync(mddev->bitmap, if (sync_blocks == 0) {
sector_nr, &sync_blocks)) if (!bitmap_start_sync(mddev->bitmap,
break; sector_nr, &sync_blocks))
if (sync_blocks < (PAGE_SIZE>>9)) break;
BUG(); if (sync_blocks < (PAGE_SIZE>>9))
if (len > (sync_blocks<<9)) len = sync_blocks<<9; BUG();
if (len > (sync_blocks<<9)) len = sync_blocks<<9;
}
}
for (i=0 ; i < conf->raid_disks; i++) { for (i=0 ; i < conf->raid_disks; i++) {
bio = r1_bio->bios[i]; bio = r1_bio->bios[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册