Message ID | 20140917111555.0e8df37f@notabene.brown (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Mike Snitzer |
Headers | show |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 6be7146be5b3..e02de054fd9f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -777,6 +777,9 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio->bi_bdev = (metadata_op && rdev->meta_bdev) ? rdev->meta_bdev : rdev->bdev; + size = roundup(size, bdev_logical_block_size(bio->bi_bdev)); + if (size > PAGE_SIZE) + return -EINVAL; if (metadata_op) bio->bi_iter.bi_sector = sector + rdev->sb_start; else if (rdev->mddev->reshape_position != MaxSector &&