From: Jeff Dike Date: Mon, 16 Jul 2007 06:38:58 +0000 (-0700) Subject: uml: limit request size on COWed devices X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8619b86f20588c020b280e6f67a9b8712b1ee38a;p=openwrt%2Fstaging%2Fblogic.git uml: limit request size on COWed devices COWed devices can't handle more than 32 (64 on x86_64) sectors in one request due to the size of the bitmap being carried around in the io_thread_req. Enforce that by telling the block layer not to put too many sectors in requests to COWed devices. Signed-off-by: Jeff Dike Cc: Paolo 'Blaisorblade' Giarrusso Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 0947f2e20045..fc27f6c72b41 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -712,6 +712,8 @@ static int ubd_add(int n, char **error_out) ubd_dev->queue->queuedata = ubd_dev; blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG); + if(ubd_dev->cow.file != NULL) + blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long)); err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]); if(err){ *error_out = "Failed to register device";