Commit cc27d75d authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] don't BUG() on too big a bio

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.
parent b4b97388
...@@ -1826,7 +1826,11 @@ void generic_make_request(struct bio *bio) ...@@ -1826,7 +1826,11 @@ void generic_make_request(struct bio *bio)
break; 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 * If this device has partitions, remap block n
...@@ -1835,8 +1839,6 @@ void generic_make_request(struct bio *bio) ...@@ -1835,8 +1839,6 @@ void generic_make_request(struct bio *bio)
blk_partition_remap(bio); blk_partition_remap(bio);
ret = q->make_request_fn(q, bio); ret = q->make_request_fn(q, bio);
blk_put_queue(q);
} while (ret); } while (ret);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment