Page MenuHomeFreeBSD

D60162.diff
No OneTemporary

D60162.diff

diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c
--- a/sys/kern/subr_epoch.c
+++ b/sys/kern/subr_epoch.c
@@ -192,7 +192,7 @@
epoch_trace_report(const char *fmt, ...)
{
va_list ap;
- struct stackentry se, *new;
+ struct stackentry se, *new, *dup;
stack_save(&se.se_stack);
@@ -205,10 +205,13 @@
bcopy(&se.se_stack, &new->se_stack, sizeof(struct stack));
mtx_lock(&epoch_stacks_lock);
- new = RB_INSERT(stacktree, &epoch_stacks, new);
+ dup = RB_INSERT(stacktree, &epoch_stacks, new);
mtx_unlock(&epoch_stacks_lock);
- if (new != NULL)
+ if (dup != NULL) {
+ /* Lost a race; the other thread reports it. */
free(new, M_STACK);
+ return;
+ }
}
va_start(ap, fmt);

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 1, 1:32 PM (19 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39989389
Default Alt Text
D60162.diff (711 B)

Event Timeline