Re: [PATCH] loop.c patches, take two

From: Ben Slusky
Date: Sun Dec 21 2003 - 18:06:46 EST


On Mon, 22 Dec 2003 01:00:39 +0200, Mika Penttil? wrote:
> 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);

--
Ben Slusky | "Looks like yet another megatrend
sluskyb@xxxxxxxxxxxxxx | has come and gone without affecting
sluskyb@xxxxxxxxxx | me in any way whatsoever."
PGP keyID ADA44B3B | www.theonion.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/