On Mon, 22 Dec 2003 01:00:39 +0200, Mika Penttil? wrote:I see, subtle...
AFAICS, this code path is never taken. You don't queue block device writes for the loop thread.
Yes I do, in loop_end_io_transfer. If we allocated fewer pages for the copy
bio than contained in the original bio, then those pages are recycled for
the next write.
@@ -413,7 +411,7 @@ static int loop_end_io_transfer(struct b
if (bio->bi_size)
return 1;
- if (err || bio_rw(bio) == WRITE) {
+ if (err || (bio_rw(bio) == WRITE && bio->bi_vcnt == rbh->bi_vcnt)) {
bio_endio(rbh, rbh->bi_size, err);
if (atomic_dec_and_test(&lo->lo_pending))
up(&lo->lo_bh_mutex);