[PATCH] Fix up initialisation of md devices
Previously, we called blk_queue_make_request(q,mddev->pers->make_request) *before* calling mddev->pers->run(), but this left a hole in which the device could be accessed before it was initialised. So we moved blk_queue_make_request to *after* ->pers->run(), but now some of the initialisation done in ->run is over-written by blk_queue_make_request(), particularly limits like ->max_sectors. So now, we just open-code the one line of blk_queue_make_request that we need at this point. All the rest has been done by a separate called to blk_queue_make_request, either when the mddev was first allocated, or when a previous incarnation of the device was stopped. This fixes "bio too big" error that occured due to max_sectors being too large.
Showing
Please register or sign in to comment