Skip to content

Commit 8f50e35

Browse files
Ming Leiaxboe
authored andcommitted
dm: limit the max bio size as BIO_MAX_PAGES * PAGE_SIZE
For BIO based DM, some targets aren't ready for dealing with bigger incoming bio than 1Mbyte, such as crypt target. Cc: Mike Snitzer <snitzer@redhat.com> Cc:dm-devel@redhat.com Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 3c892a0 commit 8f50e35

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/md/dm.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,15 @@ int dm_set_target_max_io_len(struct dm_target *ti, sector_t len)
920920
return -EINVAL;
921921
}
922922

923-
ti->max_io_len = (uint32_t) len;
923+
/*
924+
* BIO based queue uses its own splitting. When multipage bvecs
925+
* is switched on, size of the incoming bio may be too big to
926+
* be handled in some targets, such as crypt.
927+
*
928+
* When these targets are ready for the big bio, we can remove
929+
* the limit.
930+
*/
931+
ti->max_io_len = min_t(uint32_t, len, BIO_MAX_PAGES * PAGE_SIZE);
924932

925933
return 0;
926934
}

0 commit comments

Comments
 (0)