Commit 109667f8 authored by Linus Torvalds's avatar Linus Torvalds

Major partial request completion boo-boo in the bio layer.

This was _bad_. Major floppy corruption, and possibly the reason
for other block device corruption for any driver that generated
partial results for a block device request.
parent bd039e05
......@@ -1992,11 +1992,11 @@ int end_that_request_first(struct request *req, int uptodate, int nr_sectors)
* not a complete bvec done
*/
if (unlikely(nsect > nr_sectors)) {
int residual = (nsect - nr_sectors) << 9;
int partial = nr_sectors << 9;
bio->bi_size -= residual;
bio_iovec(bio)->bv_offset += residual;
bio_iovec(bio)->bv_len -= residual;
bio->bi_size -= partial;
bio_iovec(bio)->bv_offset += partial;
bio_iovec(bio)->bv_len -= partial;
blk_recalc_rq_sectors(req, nr_sectors);
blk_recalc_rq_segments(req);
return 1;
......
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