Fix I/O leakage. We're cloning bios in g_stripe_start_fast(), but when
something goes wrong while running in "fast" mode, we free all bios and falling back to "economic" mode. Freeing bios, doesn't mean decrease bio_children, so bio_inbed couldn't be equal to bio_children and request was never finished. Decrease bio_children manually when destroying bios. Reported by: Sam Lawrance <boris@brooknet.com.au>, simon
This commit is contained in:
parent
e8cd412600
commit
636f0ba584
@ -424,6 +424,7 @@ failure:
|
||||
cbp->bio_data = cbp->bio_driver1;
|
||||
cbp->bio_driver1 = NULL;
|
||||
}
|
||||
bp->bio_children--;
|
||||
g_destroy_bio(cbp);
|
||||
}
|
||||
return (error);
|
||||
@ -506,6 +507,7 @@ g_stripe_start_economic(struct bio *bp, u_int no, off_t offset, off_t length)
|
||||
failure:
|
||||
while ((cbp = TAILQ_FIRST(&queue)) != NULL) {
|
||||
TAILQ_REMOVE(&queue, cbp, bio_queue);
|
||||
bp->bio_children--;
|
||||
g_destroy_bio(cbp);
|
||||
}
|
||||
return (error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user