blob: 229701249d2f7694ea6b569cfc2955d4a889c3bd [file] [log] [blame]
From stable-bounces@linux.kernel.org Sun Jul 15 23:49:08 2007
From: Jeff Dike <jdike@addtoit.com>
Date: Sun, 15 Jul 2007 23:38:58 -0700
Subject: uml: limit request size on COWed devices
To: torvalds@linux-foundation.org
Cc: akpm@linux-foundation.org, jdike@linux.intel.com, blaisorblade@yahoo.it, jdike@addtoit.com, stable@kernel.org
Message-ID: <200707160638.l6G6cw5e014373@imap1.linux-foundation.org>
From: Jeff Dike <jdike@addtoit.com>
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 <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/um/drivers/ubd_kern.c | 2 ++
1 file changed, 2 insertions(+)
--- 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_o
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";