Skip to content

Commit

Permalink
[PATCH] md: fix bug when raid1 attempts a partial reconstruct.
Browse files Browse the repository at this point in the history
The logic here is wrong.  if fullsync is 0, it WILL BUG.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 22, 2005
1 parent 191ea9b commit ab7a30c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
if (len == 0)
break;
if (!conf->fullsync && sync_blocks == 0)
if (!bitmap_start_sync(mddev->bitmap,
sector_nr, &sync_blocks))
break;
if (sync_blocks < (PAGE_SIZE>>9))
BUG();
if (len > (sync_blocks<<9)) len = sync_blocks<<9;
if (!conf->fullsync) {
if (sync_blocks == 0) {
if (!bitmap_start_sync(mddev->bitmap,
sector_nr, &sync_blocks))
break;
if (sync_blocks < (PAGE_SIZE>>9))
BUG();
if (len > (sync_blocks<<9)) len = sync_blocks<<9;
}
}

for (i=0 ; i < conf->raid_disks; i++) {
bio = r1_bio->bios[i];
Expand Down

0 comments on commit ab7a30c

Please sign in to comment.