aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/bitmap.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index c971d38f3a05..90fe70d76a31 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -270,19 +270,20 @@ static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long inde
270 270
271 if (!page) 271 if (!page)
272 return ERR_PTR(-ENOMEM); 272 return ERR_PTR(-ENOMEM);
273 do {
274 ITERATE_RDEV(mddev, rdev, tmp)
275 if (rdev->in_sync && !rdev->faulty)
276 goto found;
277 return ERR_PTR(-EIO);
278 273
279 found: 274 ITERATE_RDEV(mddev, rdev, tmp) {
275 if (! rdev->in_sync || rdev->faulty)
276 continue;
277
280 target = (rdev->sb_offset << 1) + offset + index * (PAGE_SIZE/512); 278 target = (rdev->sb_offset << 1) + offset + index * (PAGE_SIZE/512);
281 279
282 } while (!sync_page_io(rdev->bdev, target, PAGE_SIZE, page, READ)); 280 if (sync_page_io(rdev->bdev, target, PAGE_SIZE, page, READ)) {
281 page->index = index;
282 return page;
283 }
284 }
285 return ERR_PTR(-EIO);
283 286
284 page->index = index;
285 return page;
286} 287}
287 288
288static int write_sb_page(mddev_t *mddev, long offset, struct page *page, int wait) 289static int write_sb_page(mddev_t *mddev, long offset, struct page *page, int wait)