* [uml-devel] [PATCH] UML - Fix previous request size limit fix
@ 2007-08-16 16:24 ` Jeff Dike
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Dike @ 2007-08-16 16:24 UTC (permalink / raw)
To: Andrew Morton, stable; +Cc: LKML, uml-devel
[ This is both 2.6.24 and -stable material ]
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>
--
arch/um/drivers/ubd_kern.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.21-mm/arch/um/drivers/ubd_kern.c
===================================================================
--- linux-2.6.21-mm.orig/arch/um/drivers/ubd_kern.c 2007-08-07 13:25:47.000000000 -0400
+++ linux-2.6.21-mm/arch/um/drivers/ubd_kern.c 2007-08-09 13:08:20.000000000 -0400
@@ -612,6 +612,8 @@ static int ubd_open_dev(struct ubd *ubd_
ubd_dev->fd = fd;
if(ubd_dev->cow.file != NULL){
+ blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long));
+
err = -ENOMEM;
ubd_dev->cow.bitmap = (void *) vmalloc(ubd_dev->cow.bitmap_len);
if(ubd_dev->cow.bitmap == NULL){
@@ -712,8 +714,6 @@ 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";
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH] UML - Fix previous request size limit fix
@ 2007-08-16 16:24 ` Jeff Dike
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Dike @ 2007-08-16 16:24 UTC (permalink / raw)
To: Andrew Morton, stable; +Cc: LKML, uml-devel
[ This is both 2.6.24 and -stable material ]
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>
--
arch/um/drivers/ubd_kern.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.21-mm/arch/um/drivers/ubd_kern.c
===================================================================
--- linux-2.6.21-mm.orig/arch/um/drivers/ubd_kern.c 2007-08-07 13:25:47.000000000 -0400
+++ linux-2.6.21-mm/arch/um/drivers/ubd_kern.c 2007-08-09 13:08:20.000000000 -0400
@@ -612,6 +612,8 @@ static int ubd_open_dev(struct ubd *ubd_
ubd_dev->fd = fd;
if(ubd_dev->cow.file != NULL){
+ blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long));
+
err = -ENOMEM;
ubd_dev->cow.bitmap = (void *) vmalloc(ubd_dev->cow.bitmap_len);
if(ubd_dev->cow.bitmap == NULL){
@@ -712,8 +714,6 @@ 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";
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-16 16:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16 16:24 [uml-devel] [PATCH] UML - Fix previous request size limit fix Jeff Dike
2007-08-16 16:24 ` Jeff Dike
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.