aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/dm-io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-17 08:59:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-17 08:59:33 -0700
commit18439c39e826191c0ef08c3a3271ce7ece46a860 (patch)
tree71594d3d002c2bb65014c21001ee5a57aac8c76a /drivers/md/dm-io.c
parent9e8912e04e612b43897b4b722205408b92f423e5 (diff)
parentb35f8caa0890169000fec22902290d9a15274cbd (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: dm crypt: wait for endio to complete before destruction dm crypt: fix kcryptd_async_done parameter dm io: respect BIO_MAX_PAGES limit dm table: rework reference counting fix dm ioctl: validate name length when renaming
Diffstat (limited to 'drivers/md/dm-io.c')
-rw-r--r--drivers/md/dm-io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index f14813be4ef..36e2b5e46a6 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -292,6 +292,8 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
(PAGE_SIZE >> SECTOR_SHIFT));
num_bvecs = 1 + min_t(int, bio_get_nr_vecs(where->bdev),
num_bvecs);
+ if (unlikely(num_bvecs > BIO_MAX_PAGES))
+ num_bvecs = BIO_MAX_PAGES;
bio = bio_alloc_bioset(GFP_NOIO, num_bvecs, io->client->bios);
bio->bi_sector = where->sector + (where->count - remaining);
bio->bi_bdev = where->bdev;