Skip to contentSkip to conversation

Block layer bug handling partial bvec

PATCH In review Sean Estabrooks 2 participants 2 messages Jul 27, 2003 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Block layer bug handling partial bvec

Previously I submitted a patch for "blk: request botched" on floppy write. While the patch did make the floppy work, Jens mentioned
that an underlying error still existed. This spurred me on to look a
little deeper and finally i found the root cause.

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. Note that with the attached patch, my previous floppy_ patch is no longer needed.

Cheers,
Sean

drivers/block/ll_rw_blk.c +2 -2
@@ -2307,8 +2307,8 @@
 			 * 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;
#1 lore raw
Quoted 9 lines · Sean Estabrooks

Previously I submitted a patch for "blk: request botched" on floppy write. While the patch did make the floppy work, Jens mentioned
that an underlying error still existed. This spurred me on to look a
little deeper and finally i found the root cause.

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. Note that with the attached patch, my previous floppy_ patch is no longer needed.

Good catch! Applied.

Signature · 1 line
Jens Axboe