提交 74de82ed 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://neil.brown.name/md

* '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.
...@@ -1000,10 +1000,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start) ...@@ -1000,10 +1000,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
page = bitmap->sb_page; page = bitmap->sb_page;
offset = sizeof(bitmap_super_t); offset = sizeof(bitmap_super_t);
if (!file) if (!file)
read_sb_page(bitmap->mddev, page = read_sb_page(
bitmap->mddev->bitmap_info.offset, bitmap->mddev,
page, bitmap->mddev->bitmap_info.offset,
index, count); page,
index, count);
} else if (file) { } else if (file) {
page = read_page(file, index, bitmap, count); page = read_page(file, index, bitmap, count);
offset = 0; offset = 0;
......
...@@ -1839,7 +1839,9 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -1839,7 +1839,9 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
/* take from bio_init */ /* take from bio_init */
bio->bi_next = NULL; bio->bi_next = NULL;
bio->bi_flags &= ~(BIO_POOL_MASK-1);
bio->bi_flags |= 1 << BIO_UPTODATE; bio->bi_flags |= 1 << BIO_UPTODATE;
bio->bi_comp_cpu = -1;
bio->bi_rw = READ; bio->bi_rw = READ;
bio->bi_vcnt = 0; bio->bi_vcnt = 0;
bio->bi_idx = 0; bio->bi_idx = 0;
...@@ -1912,7 +1914,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -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)) !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
break; break;
BUG_ON(sync_blocks < (PAGE_SIZE>>9)); BUG_ON(sync_blocks < (PAGE_SIZE>>9));
if (len > (sync_blocks<<9)) if ((len >> 9) > sync_blocks)
len = sync_blocks<<9; len = sync_blocks<<9;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册