]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Fix block layer bug handling of partial bvec completion
authorJens Axboe <axboe@suse.de>
Sun, 27 Jul 2003 02:13:05 +0000 (19:13 -0700)
committerJens Axboe <axboe@suse.de>
Sun, 27 Jul 2003 02:13:05 +0000 (19:13 -0700)
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.

drivers/block/ll_rw_blk.c

index 137fa4beb366355630cc00dc8fcd44b21eea9ca4..1d9e204f99d4ce8214f030e4b22f3b0a2a9a4af5 100644 (file)
@@ -2307,8 +2307,8 @@ static int __end_that_request_first(struct request *req, int uptodate,
                         * not a complete bvec done
                         */
                        if (unlikely(nbytes > nr_bytes)) {
-                               bio_iovec(bio)->bv_offset += nr_bytes;
-                               bio_iovec(bio)->bv_len -= nr_bytes;
+                               bio_iovec_idx(bio, idx)->bv_offset += nr_bytes;
+                               bio_iovec_idx(bio, idx)->bv_len -= nr_bytes;
                                bio_nbytes += nr_bytes;
                                total_bytes += nr_bytes;
                                break;