diff --git a/[refs] b/[refs] index f9308aaabffe..df54a6e868e6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 53b351f972a882ea8b6cdb19602535f1057c884a +refs/heads/master: 8cbeb67ad50f7d68e5e83be2cb2284de8f9c03b5 diff --git a/trunk/drivers/md/dm.c b/trunk/drivers/md/dm.c index f1db689667ea..59806e67a175 100644 --- a/trunk/drivers/md/dm.c +++ b/trunk/drivers/md/dm.c @@ -925,6 +925,16 @@ static int dm_merge_bvec(struct request_queue *q, */ if (max_size && ti->type->merge) max_size = ti->type->merge(ti, bvm, biovec, max_size); + /* + * If the target doesn't support merge method and some of the devices + * provided their merge_bvec method (we know this by looking at + * queue_max_hw_sectors), then we can't allow bios with multiple vector + * entries. So always set max_size to 0, and the code below allows + * just one page. + */ + else if (queue_max_hw_sectors(q) <= PAGE_SIZE >> 9) + + max_size = 0; out_table: dm_table_put(map);