Skip to contentSkip to conversation

drivers/block/floppy.c: Premature blk_queue_max_sectors()

PATCH In review Arthur Othieno 4 participants 5 messages May 21, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/block/floppy.c: Premature blk_queue_max_sectors()

Hi,

We're prematurely pampering the request queue before checking whether it was indeed allocated successfully.

Against 2.6.6. Thanks.

 floppy.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/block/floppy.c +1 -1
@@ -4271,11 +4271,11 @@
 		goto out;
 
 	floppy_queue = blk_init_queue(do_fd_request, &floppy_lock);
-	blk_queue_max_sectors(floppy_queue, 64);
 	if (!floppy_queue) {
 		err = -ENOMEM;
 		goto fail_queue;
 	}
+	blk_queue_max_sectors(floppy_queue, 64);
 
 	blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE,
 			    floppy_find, NULL, NULL);
#1 lore raw
Quoted 14 lines · Arthur Othieno

Hi,

We're prematurely pampering the request queue before checking whether it was indeed allocated successfully.

Against 2.6.6. Thanks.

 floppy.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

drivers/block/floppy.c line 4278

Quoted 9 lines
drivers/block/floppy.c +1 -1
@@ -4271,11 +4271,11 @@
 		goto out;
 
 	floppy_queue = blk_init_queue(do_fd_request, &floppy_lock);
-	blk_queue_max_sectors(floppy_queue, 64);
 	if (!floppy_queue) {
 		err = -ENOMEM;
 		goto fail_queue;
 	}
+	blk_queue_max_sectors(floppy_queue, 64);

Good catch...

Jeff

#2 lore raw
In reply to Arthur Othieno
Quoted 14 lines · Arthur Othieno

We're prematurely pampering the request queue before checking whether it was indeed allocated successfully.

Against 2.6.6. Thanks.

 floppy.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/block/floppy.c +0 -0
@@ -4271,11 +4271,11 @@
 		goto out;
 

drivers/block/floppy.c line 4281

Quoted 10 lines
drivers/block/floppy.c +1 -1
 	floppy_queue = blk_init_queue(do_fd_request, &floppy_lock);
-	blk_queue_max_sectors(floppy_queue, 64);
 	if (!floppy_queue) {
 		err = -ENOMEM;
 		goto fail_queue;
 	}
+	blk_queue_max_sectors(floppy_queue, 64);
 
 	blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE,
 			    floppy_find, NULL, NULL);

ooh nice.

#3 lore raw
In reply to Arthur Othieno

Hi Arthur,

Em Fri, May 21, 2004 at 09:59:34PM +0200, Arthur Othieno escreveu:

| We're prematurely pampering the request queue before
| checking whether it was indeed allocated successfully.
| 
| Against 2.6.6. Thanks.
| 
| 
|  floppy.c |    2 +-
|  1 files changed, 1 insertion(+), 1 deletion(-)
| 
| --- a/drivers/block/floppy.c	2004-05-20 23:48:04.000000000 +0200
| +++ b/drivers/block/floppy.c	2004-05-21 21:29:33.000000000 +0200
| @@ -4271,11 +4271,11 @@
|  		goto out;
|  
|  	floppy_queue = blk_init_queue(do_fd_request, &floppy_lock);
| -	blk_queue_max_sectors(floppy_queue, 64);
|  	if (!floppy_queue) {
|  		err = -ENOMEM;
|  		goto fail_queue;
|  	}
| +	blk_queue_max_sectors(floppy_queue, 64);
|  
|  	blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE,
|  			    floppy_find, NULL, NULL);

I and Randy did a (long) audit for floppy init sometime ago. It includes
your change. :-)

I think the patch will be in next -mm.

Signature · 2 lines
Luiz Fernando N. Capitulino
<http://www.telecentros.sp.gov.br>
#4 lore raw
Quoted 10 lines · Luiz Fernando N. Capitulino

Em Fri, May 21, 2004 at 09:59:34PM +0200, Arthur Othieno escreveu:

| We're prematurely pampering the request queue before
| checking whether it was indeed allocated successfully.
| 
| Against 2.6.6. Thanks.
| 
| 
|  floppy.c |    2 +-
|  1 files changed, 1 insertion(+), 1 deletion(-)
|

snip

Quoted 4 lines

I and Randy did a (long) audit for floppy init sometime ago. It includes your change. :-)

I think the patch will be in next -mm.

Glad to hear that. It was beginning to look a little too scary ;)

Arthur