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
This commit is contained in:
Pawel Jakub Dawidek 2004-08-11 12:04:35 +00:00
parent 2eccc90b61
commit 1b949c05a3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133487

View File

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