aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-07 13:50:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-07 13:50:48 -0700
commit74de82ed1e49d9c7af84c3beb3759316854f54ed (patch)
tree1b2f5ffe0250f193ae2d926d6354daf231bd9278 /drivers
parentdda9cd9fb30dfe6f2a51a394c18aef7c401b497d (diff)
parent5c04f5512f8134c75cd36e5b0354e10e330f4e6e (diff)
downloadkernel_samsung_espresso10-74de82ed1e49d9c7af84c3beb3759316854f54ed.zip
kernel_samsung_espresso10-74de82ed1e49d9c7af84c3beb3759316854f54ed.tar.gz
kernel_samsung_espresso10-74de82ed1e49d9c7af84c3beb3759316854f54ed.tar.bz2
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.c9
-rw-r--r--drivers/md/raid1.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index ed4900a..e4fb58d 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)
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;
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index ad83a4d..0b830bb 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
/* 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;
}