Skip to content

Commit

Permalink
cmap: ovsrcu postpone the cmap destroy.
Browse files Browse the repository at this point in the history
Currently, the cmap_destroy() directly frees the cmap memory.
Some callers of cmap_destroy() (e.g. destroy_subtable()) still
allows other threads (e.g. pmd threads) accessing the cmap at
the same time (e.g. via classifier_lookup_miniflow_batch()),
which could cause segfault.

To fix the above issue, this commit use ovsrcu to postpone
the free of cmap memory.

Reported-by: Ethan Jackson <[email protected]>
Signed-off-by: Alex Wang <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
yew011 committed Oct 1, 2014
1 parent 58f1953 commit 7530fe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void
cmap_destroy(struct cmap *cmap)
{
if (cmap) {
free_cacheline(cmap_get_impl(cmap));
ovsrcu_postpone(free_cacheline, cmap_get_impl(cmap));
}
}

Expand Down

0 comments on commit 7530fe0

Please sign in to comment.