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

From: Mika Penttilä
Date: Sun Dec 21 2003 - 18:48:23 EST




Ben Slusky wrote:

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);


I see, subtle...

--Mika


-
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/