]> git.hungrycats.org Git - linux/commitdiff
[PATCH] don't BUG() on too big a bio
authorJens Axboe <axboe@suse.de>
Mon, 30 Sep 2002 05:34:11 +0000 (22:34 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Mon, 30 Sep 2002 05:34:11 +0000 (22:34 -0700)
There's really no reason to BUG() out on a bio that is too big, the
gentleman thing to do would be to print a warning and just end the bio
with -EIO quietly.

drivers/block/ll_rw_blk.c

index 985a1dd6f8693778a85301bdb8f57ef1f2b469a2..341b07f7b316bb9b4c69686299b2cce0071af997 100644 (file)
@@ -1826,7 +1826,11 @@ end_io:
                        break;
                }
 
-               BUG_ON(bio_sectors(bio) > q->max_sectors);
+               if (unlikely(bio_sectors(bio) > q->max_sectors)) {
+                       printk("bio too big (%u > %u)\n", bio_sectors(bio),
+                                                       q->max_sectors);
+                       goto end_io;
+               }
 
                /*
                 * If this device has partitions, remap block n
@@ -1835,8 +1839,6 @@ end_io:
                blk_partition_remap(bio);
 
                ret = q->make_request_fn(q, bio);
-               blk_put_queue(q);
-
        } while (ret);
 }