Commit 176a9075 authored by Jens Axboe's avatar Jens Axboe

[PATCH] Fix block layer bug handling of partial bvec completion

Noted by Sean Estabrooks:

There is a bug in "ll_rw_blk.c" handling partial bvec submissions.
For whatever reason the floppy driver was triggering it more than
other users (most likely because most other devices tend to be able
to always complete a full request in one go).

Fixed by updating the proper bio vector index entry.
parent f374048e
...@@ -2307,8 +2307,8 @@ static int __end_that_request_first(struct request *req, int uptodate, ...@@ -2307,8 +2307,8 @@ static int __end_that_request_first(struct request *req, int uptodate,
* not a complete bvec done * not a complete bvec done
*/ */
if (unlikely(nbytes > nr_bytes)) { if (unlikely(nbytes > nr_bytes)) {
bio_iovec(bio)->bv_offset += nr_bytes; bio_iovec_idx(bio, idx)->bv_offset += nr_bytes;
bio_iovec(bio)->bv_len -= nr_bytes; bio_iovec_idx(bio, idx)->bv_len -= nr_bytes;
bio_nbytes += nr_bytes; bio_nbytes += nr_bytes;
total_bytes += nr_bytes; total_bytes += nr_bytes;
break; break;
......
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