diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-07 16:50:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-07 16:50:48 -0400 |
commit | 74de82ed1e49d9c7af84c3beb3759316854f54ed (patch) | |
tree | 1b2f5ffe0250f193ae2d926d6354daf231bd9278 /drivers | |
parent | dda9cd9fb30dfe6f2a51a394c18aef7c401b497d (diff) | |
parent | 5c04f5512f8134c75cd36e5b0354e10e330f4e6e (diff) |
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.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/bitmap.c | 9 | ||||
-rw-r--r-- | drivers/md/raid1.c | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index ed4900ade93a..e4fb58db5454 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1000,10 +1000,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start) | |||
1000 | page = bitmap->sb_page; | 1000 | page = bitmap->sb_page; |
1001 | offset = sizeof(bitmap_super_t); | 1001 | offset = sizeof(bitmap_super_t); |
1002 | if (!file) | 1002 | if (!file) |
1003 | read_sb_page(bitmap->mddev, | 1003 | page = read_sb_page( |
1004 | bitmap->mddev->bitmap_info.offset, | 1004 | bitmap->mddev, |
1005 | page, | 1005 | bitmap->mddev->bitmap_info.offset, |
1006 | index, count); | 1006 | page, |
1007 | index, count); | ||
1007 | } else if (file) { | 1008 | } else if (file) { |
1008 | page = read_page(file, index, bitmap, count); | 1009 | page = read_page(file, index, bitmap, count); |
1009 | offset = 0; | 1010 | offset = 0; |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ad83a4dcadc3..0b830bbe1d8b 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1839,7 +1839,9 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1839 | 1839 | ||
1840 | /* take from bio_init */ | 1840 | /* take from bio_init */ |
1841 | bio->bi_next = NULL; | 1841 | bio->bi_next = NULL; |
1842 | bio->bi_flags &= ~(BIO_POOL_MASK-1); | ||
1842 | bio->bi_flags |= 1 << BIO_UPTODATE; | 1843 | bio->bi_flags |= 1 << BIO_UPTODATE; |
1844 | bio->bi_comp_cpu = -1; | ||
1843 | bio->bi_rw = READ; | 1845 | bio->bi_rw = READ; |
1844 | bio->bi_vcnt = 0; | 1846 | bio->bi_vcnt = 0; |
1845 | bio->bi_idx = 0; | 1847 | bio->bi_idx = 0; |
@@ -1912,7 +1914,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1912 | !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) | 1914 | !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) |
1913 | break; | 1915 | break; |
1914 | BUG_ON(sync_blocks < (PAGE_SIZE>>9)); | 1916 | BUG_ON(sync_blocks < (PAGE_SIZE>>9)); |
1915 | if (len > (sync_blocks<<9)) | 1917 | if ((len >> 9) > sync_blocks) |
1916 | len = sync_blocks<<9; | 1918 | len = sync_blocks<<9; |
1917 | } | 1919 | } |
1918 | 1920 | ||