From 83b03fe05e7a6734b2096dab86937294769987c6 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 6 Jan 2016 15:44:39 -0800 Subject: [PATCH] ofproto-dpif-upcall: Avoid double-delete of ukeys. revalidate_sweep__() has two cases where it calls ukey_delete() to remove a ukey from the umap via cmap_remove(). The first case is a direct call to ukey_delete(), when !flow_exists. The second case is an indirect call via push_ukey_ops(), when result != UKEY_KEEP. If both of these conditions are simultaneously true, however, the code would call ukey_delete() twice, causing an assertion failure in the second call. This commit fixes the problem by eliminating one of the calls. The version tested by Ben Warren differs from this version, see: http://openvswitch.org/pipermail/dev/2016-January/064117.html Reported-by: Keith Holleman Reported-at: http://openvswitch.org/pipermail/discuss/2015-December/019772.html CC: Joe Stringer VMware-BZ: #1579057 Signed-off-by: Ben Pfaff Tested-by: Ben Warren --- ofproto/ofproto-dpif-upcall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index cd8a9f0c3..d1e941a5d 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -2262,7 +2262,7 @@ revalidator_sweep__(struct revalidator *revalidator, bool purge) result = revalidate_ukey(udpif, ukey, &stats, &odp_actions, reval_seq, &recircs); } - if (result != UKEY_KEEP) { + if (flow_exists && result != UKEY_KEEP) { /* Takes ownership of 'recircs'. */ reval_op_init(&ops[n_ops++], result, udpif, ukey, &recircs, &odp_actions); -- 2.20.1