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.
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
blk_partition_remap(bio);
ret = q->make_request_fn(q, bio);
- blk_put_queue(q);
-
} while (ret);
}