summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorbmilekic <bmilekic@FreeBSD.org>2004-10-27 21:19:35 +0000
committerbmilekic <bmilekic@FreeBSD.org>2004-10-27 21:19:35 +0000
commit13ebdd218ab218ea8c95c02b6f83e2da1fbf3f3c (patch)
tree33d54b8e3a1c40d5257f224cccae222d31d31c21 /sys/vm
parent26ee4cc6175388420b7741f49e8ea827d4a980c7 (diff)
downloadFreeBSD-src-13ebdd218ab218ea8c95c02b6f83e2da1fbf3f3c.zip
FreeBSD-src-13ebdd218ab218ea8c95c02b6f83e2da1fbf3f3c.tar.gz
Fix a INVARIANTS-only bug introduced in Revision 1.104:
IF INVARIANTS is defined, and in the rare case that we have allocated some objects from the slab and at least one initializer on at least one of those objects failed, and we need to fail the allocation and push the uninitialized items back into the slab caches -- in that scenario, we would fail to [re]set the bucket cache's ub_bucket item references to NULL, which would eventually trigger a KASSERT.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/uma_core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 569934b..6850039 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -2093,9 +2093,13 @@ uma_zalloc_bucket(uma_zone_t zone, int flags)
if (i != bucket->ub_cnt) {
int j;
- for (j = i; j < bucket->ub_cnt; j++)
+ for (j = i; j < bucket->ub_cnt; j++) {
uma_zfree_internal(zone, bucket->ub_bucket[j],
NULL, SKIP_FINI);
+#ifdef INVARIANTS
+ bucket->ub_bucket[j] = NULL;
+#endif
+ }
bucket->ub_cnt = i;
}
ZONE_LOCK(zone);
OpenPOWER on IntegriCloud