diff options
author | phk <phk@FreeBSD.org> | 2003-08-13 12:35:25 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-08-13 12:35:25 +0000 |
commit | b43271d3a408f45d85551d172fbecf2a0c8e1481 (patch) | |
tree | 6877aa90054188cf016980d5c0ccb9fa329b375d /sys/geom/geom_dev.c | |
parent | c98cd0b1e39d026b6a97be36313d74ca496acebb (diff) | |
download | FreeBSD-src-b43271d3a408f45d85551d172fbecf2a0c8e1481.zip FreeBSD-src-b43271d3a408f45d85551d172fbecf2a0c8e1481.tar.gz |
Replace a panic with a .1Hz retry loop.
Not a perfect solution, but far cheaper than one.
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r-- | sys/geom/geom_dev.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index a4b13b5..6104aed 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -396,7 +396,16 @@ g_dev_strategy(struct bio *bp) KASSERT(cp->acr || cp->acw, ("Consumer with zero access count in g_dev_strategy")); - bp2 = g_clone_bio(bp); + for (;;) { + /* + * XXX: This is not an ideal solution, but I belive it to + * XXX: deadlock safe, all things considered. + */ + bp2 = g_clone_bio(bp); + if (bp2 != NULL) + break; + tsleep(&bp, PRIBIO, "gdstrat", hz / 10); + } KASSERT(bp2 != NULL, ("XXX: ENOMEM in a bad place")); bp2->bio_offset = (off_t)bp->bio_blkno << DEV_BSHIFT; KASSERT(bp2->bio_offset >= 0, |