diff options
Diffstat (limited to 'drivers/md/dm-io.c')
-rw-r--r-- | drivers/md/dm-io.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index a34338567a2a..36e2b5e46a6b 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, | |||
292 | (PAGE_SIZE >> SECTOR_SHIFT)); | 292 | (PAGE_SIZE >> SECTOR_SHIFT)); |
293 | num_bvecs = 1 + min_t(int, bio_get_nr_vecs(where->bdev), | 293 | num_bvecs = 1 + min_t(int, bio_get_nr_vecs(where->bdev), |
294 | num_bvecs); | 294 | num_bvecs); |
295 | if (unlikely(num_bvecs > BIO_MAX_PAGES)) | ||
296 | num_bvecs = BIO_MAX_PAGES; | ||
295 | bio = bio_alloc_bioset(GFP_NOIO, num_bvecs, io->client->bios); | 297 | bio = bio_alloc_bioset(GFP_NOIO, num_bvecs, io->client->bios); |
296 | bio->bi_sector = where->sector + (where->count - remaining); | 298 | bio->bi_sector = where->sector + (where->count - remaining); |
297 | bio->bi_bdev = where->bdev; | 299 | bio->bi_bdev = where->bdev; |
@@ -328,7 +330,7 @@ static void dispatch_io(int rw, unsigned int num_regions, | |||
328 | struct dpages old_pages = *dp; | 330 | struct dpages old_pages = *dp; |
329 | 331 | ||
330 | if (sync) | 332 | if (sync) |
331 | rw |= (1 << BIO_RW_SYNC); | 333 | rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG); |
332 | 334 | ||
333 | /* | 335 | /* |
334 | * For multiple regions we need to be careful to rewind | 336 | * For multiple regions we need to be careful to rewind |