From 9b99e39d618cba0aa357b2d5a5150b69fead5801 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 25 Apr 2003 21:43:11 +0000 Subject: [PATCH] Do an explicit retry after we have dumped the cache, rather than a (potential) tail recursion. --- sys/geom/bde/g_bde_work.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/geom/bde/g_bde_work.c b/sys/geom/bde/g_bde_work.c index 1093566d1ad4..6b5d763abb52 100644 --- a/sys/geom/bde/g_bde_work.c +++ b/sys/geom/bde/g_bde_work.c @@ -251,15 +251,12 @@ g_bde_get_sector(struct g_bde_work *wp, off_t offset) if (sp != NULL) { TAILQ_REMOVE(&sc->freelist, sp, list); TAILQ_INSERT_TAIL(&sc->freelist, sp, list); + sp->used = time_uptime; } wp->ksp = sp; if (sp == NULL) { g_bde_purge_sector(sc, -1); - sp = g_bde_get_sector(wp, offset); } - if (sp != NULL) - sp->used = time_uptime; - KASSERT(sp != NULL, ("get_sector failed")); return(sp); } @@ -336,6 +333,8 @@ g_bde_read_keysector(struct g_bde_softc *sc, struct g_bde_work *wp) g_trace(G_T_TOPOLOGY, "g_bde_read_keysector(%p)", wp); sp = g_bde_get_sector(wp, wp->kso); + if (sp == NULL) + sp = g_bde_get_sector(wp, wp->kso); if (sp == NULL) return (sp); if (sp->owner != wp)