diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-06-21 20:17:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 22:07:46 -0400 |
commit | ab7a30c7051ee32d0d72415fe0a16d60eba38a0d (patch) | |
tree | ab053c3d097e9ef7d2448944b8a20c8b0b8117a4 /drivers/md | |
parent | 191ea9b2c7cc3ebbe0678834ab710d7d95ad3f9a (diff) |
[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: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 0fd4c3bfc85..9d9acc3e51a 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1237,13 +1237,16 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1237 | len = (max_sector - sector_nr) << 9; | 1237 | len = (max_sector - sector_nr) << 9; |
1238 | if (len == 0) | 1238 | if (len == 0) |
1239 | break; | 1239 | break; |
1240 | if (!conf->fullsync && sync_blocks == 0) | 1240 | if (!conf->fullsync) { |
1241 | if (!bitmap_start_sync(mddev->bitmap, | 1241 | if (sync_blocks == 0) { |
1242 | sector_nr, &sync_blocks)) | 1242 | if (!bitmap_start_sync(mddev->bitmap, |
1243 | break; | 1243 | sector_nr, &sync_blocks)) |
1244 | if (sync_blocks < (PAGE_SIZE>>9)) | 1244 | break; |
1245 | BUG(); | 1245 | if (sync_blocks < (PAGE_SIZE>>9)) |
1246 | if (len > (sync_blocks<<9)) len = sync_blocks<<9; | 1246 | BUG(); |
1247 | if (len > (sync_blocks<<9)) len = sync_blocks<<9; | ||
1248 | } | ||
1249 | } | ||
1247 | 1250 | ||
1248 | for (i=0 ; i < conf->raid_disks; i++) { | 1251 | for (i=0 ; i < conf->raid_disks; i++) { |
1249 | bio = r1_bio->bios[i]; | 1252 | bio = r1_bio->bios[i]; |