diff options
author | pjd <pjd@FreeBSD.org> | 2004-08-11 12:04:35 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-08-11 12:04:35 +0000 |
commit | 8623e8af4ddee49da855613b1c3a6f95bfb25716 (patch) | |
tree | f8eafe76e848670e3174ee307f5e49efff7b20bb /sys/geom/geom_io.c | |
parent | a93503bce5774a1d50bc8d2659fa612fd093c64a (diff) | |
download | FreeBSD-src-8623e8af4ddee49da855613b1c3a6f95bfb25716.zip FreeBSD-src-8623e8af4ddee49da855613b1c3a6f95bfb25716.tar.gz |
When sending request once again because of ENOMEM, reset bio_children
and bio_inbed fields to 0. Without this change we can end up with
I/O leakage in some rare situations.
I tested this change by putting failure probability mechanism simlar
to this used in NOP class into g_clone_bio(9) function, so it was
able to return NULL with the given probability.
Discussed with: phk
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r-- | sys/geom/geom_io.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 19d5de7..89b0e39 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -300,6 +300,8 @@ g_io_deliver(struct bio *bp, int error) if (error == ENOMEM) { if (bootverbose) printf("ENOMEM %p on %p(%s)\n", bp, pp, pp->name); + bp->bio_children = 0; + bp->bio_inbed = 0; g_io_request(bp, cp); pace++; return; |