diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-08-22 17:01:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-22 22:52:46 -0400 |
commit | f4768ffd1d4b7b07ae2c4c3d93c9f99cd68e996c (patch) | |
tree | 09c2e345501370a3462331a2b9de3afe6afb0bd6 /arch | |
parent | a88aa7865bc1d1d451af2d585ac0119164ce8e00 (diff) |
uml: fix previous request size limit fix
The previous patch which limited the number of sectors in a single request
to a COWed device was correct in concept, but the limit was implemented in
the wrong place.
By putting it in ubd_add, it covered the cases where the COWing was
specified on the command line. However, when the command line only has the
COW file specified, the fact that it's a COW file isn't known until it's
opened, so the limit is missed in these cases.
This patch moves the sector limit from ubd_add to ubd_open_dev.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index aff661fe2ee1..0eabe73c964d 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -612,6 +612,8 @@ static int ubd_open_dev(struct ubd *ubd_dev) | |||
612 | ubd_dev->fd = fd; | 612 | ubd_dev->fd = fd; |
613 | 613 | ||
614 | if(ubd_dev->cow.file != NULL){ | 614 | if(ubd_dev->cow.file != NULL){ |
615 | blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long)); | ||
616 | |||
615 | err = -ENOMEM; | 617 | err = -ENOMEM; |
616 | ubd_dev->cow.bitmap = (void *) vmalloc(ubd_dev->cow.bitmap_len); | 618 | ubd_dev->cow.bitmap = (void *) vmalloc(ubd_dev->cow.bitmap_len); |
617 | if(ubd_dev->cow.bitmap == NULL){ | 619 | if(ubd_dev->cow.bitmap == NULL){ |
@@ -712,8 +714,6 @@ static int ubd_add(int n, char **error_out) | |||
712 | ubd_dev->queue->queuedata = ubd_dev; | 714 | ubd_dev->queue->queuedata = ubd_dev; |
713 | 715 | ||
714 | blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG); | 716 | blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG); |
715 | if(ubd_dev->cow.file != NULL) | ||
716 | blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long)); | ||
717 | err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]); | 717 | err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]); |
718 | if(err){ | 718 | if(err){ |
719 | *error_out = "Failed to register device"; | 719 | *error_out = "Failed to register device"; |