--- linux-2.6.5-rc2/fs/bio.c 2004-03-22 22:44:28.000000000 -0800 +++ linux-2.6.5-rc2-ec/fs/bio.c 2004-03-22 23:00:18.000000000 -0800 @@ -701,11 +701,12 @@ static int bio_pair_end_1(struct bio * b { struct bio_pair *bp = container_of(bi, struct bio_pair, bio1); - if (bi->bi_size) - return 1; if (err) bp->error = err; + if (bi->bi_size) + return 1; + bio_pair_release(bp); return 0; } @@ -714,11 +715,12 @@ static int bio_pair_end_2(struct bio * b { struct bio_pair *bp = container_of(bi, struct bio_pair, bio2); - if (bi->bi_size) - return 1; if (err) bp->error = err; + if (bi->bi_size) + return 1; + bio_pair_release(bp); return 0; }