summaryrefslogtreecommitdiffstats
path: root/runtime/pmap-gen.c
diff options
context:
space:
mode:
authorhunt <hunt>2006-01-19 19:26:32 +0000
committerhunt <hunt>2006-01-19 19:26:32 +0000
commit46746514a6943520ff73b6f77d35477e2abb30ba (patch)
tree870674338b7b7b82b87b515886a5d77099390b61 /runtime/pmap-gen.c
parenta7978f80f7621ffba04999b7c1360afa242b01dd (diff)
downloadsystemtap-steved-46746514a6943520ff73b6f77d35477e2abb30ba.tar.gz
systemtap-steved-46746514a6943520ff73b6f77d35477e2abb30ba.tar.xz
systemtap-steved-46746514a6943520ff73b6f77d35477e2abb30ba.zip
2006-01-19 Martin Hunt <hunt@redhat.com>
* pmap-gen.c (_stp_pmap_get): Fix bug where old data from agg map could be returned after element was deleted.
Diffstat (limited to 'runtime/pmap-gen.c')
-rw-r--r--runtime/pmap-gen.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/runtime/pmap-gen.c b/runtime/pmap-gen.c
index 035fccbf..21a0aef4 100644
--- a/runtime/pmap-gen.c
+++ b/runtime/pmap-gen.c
@@ -617,7 +617,7 @@ VALTYPE KEYSYM(_stp_pmap_get_cpu) (PMAP pmap, ALLKEYSD(key))
VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key))
{
unsigned int hv;
- int cpu;
+ int cpu, clear_agg = 0;
struct hlist_head *head, *ahead;
struct hlist_node *e;
struct KEYSYM(pmap_node) *n;
@@ -649,7 +649,7 @@ VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key))
#endif
) {
anode = (struct map_node *)n;
- _new_map_clear_node (anode);
+ clear_agg = 1;
break;
}
}
@@ -681,13 +681,18 @@ VALTYPE KEYSYM(_stp_pmap_get) (PMAP pmap, ALLKEYSD(key))
if (anode == NULL) {
dbug("agg=%lx ahead=%lx\n", (long)agg, (long)ahead);
anode = _stp_new_agg(agg, ahead, (struct map_node *)n);
- } else
+ } else {
+ if (clear_agg) {
+ _new_map_clear_node (anode);
+ clear_agg = 0;
+ }
_stp_add_agg(anode, (struct map_node *)n);
+ }
}
}
spin_unlock(&map->lock);
}
- if (anode)
+ if (anode && !clear_agg)
return MAP_GET_VAL(anode);
/* key not found */