]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'for-linus' of git://neil.brown.name/md
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Oct 2010 20:50:48 +0000 (13:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Oct 2010 20:50:48 +0000 (13:50 -0700)
* 'for-linus' of git://neil.brown.name/md:
  md: check return code of read_sb_page
  md/raid1: minor bio initialisation improvements.
  md/raid1:  avoid overflow in raid1 resync when bitmap is in use.

drivers/md/bitmap.c
drivers/md/raid1.c

index ed4900ade93a4d80b84784e76aafc406689020b2..e4fb58db5454d4bfc5cc5257bb74435907b3b3f2 100644 (file)
@@ -1000,10 +1000,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
                                page = bitmap->sb_page;
                                offset = sizeof(bitmap_super_t);
                                if (!file)
-                                       read_sb_page(bitmap->mddev,
-                                                    bitmap->mddev->bitmap_info.offset,
-                                                    page,
-                                                    index, count);
+                                       page = read_sb_page(
+                                               bitmap->mddev,
+                                               bitmap->mddev->bitmap_info.offset,
+                                               page,
+                                               index, count);
                        } else if (file) {
                                page = read_page(file, index, bitmap, count);
                                offset = 0;
index ad83a4dcadc3ed7cafa914d2e4dcb7ef1a939fdf..0b830bbe1d8b6323bac02106c2ccc4d806e1e390 100644 (file)
@@ -1839,7 +1839,9 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
 
                /* take from bio_init */
                bio->bi_next = NULL;
+               bio->bi_flags &= ~(BIO_POOL_MASK-1);
                bio->bi_flags |= 1 << BIO_UPTODATE;
+               bio->bi_comp_cpu = -1;
                bio->bi_rw = READ;
                bio->bi_vcnt = 0;
                bio->bi_idx = 0;
@@ -1912,7 +1914,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
                            !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
                                break;
                        BUG_ON(sync_blocks < (PAGE_SIZE>>9));
-                       if (len > (sync_blocks<<9))
+                       if ((len >> 9) > sync_blocks)
                                len = sync_blocks<<9;
                }