ofproto: make oftable_remove_rule__ release evict lock
authorYAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Mon, 12 Aug 2013 23:00:05 +0000 (08:00 +0900)
committerBen Pfaff <blp@nicira.com>
Mon, 12 Aug 2013 23:47:00 +0000 (16:47 -0700)
according to the OVS_RELEASES annotation, oftable_remove_rule__ is
expected to release rule->evict lock.  make it actually do so.

this fixes pthread_rwlock_destroy failures observed on NetBSD,
where destroying a held lock, which is specwise undefined behaviour,
actually fails.  i guess it doesn't fail on linux but it's better
not to rely on an undefined behavior.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto.c

index c7fc09b..44a6f9d 100644 (file)
@@ -5475,6 +5475,7 @@ oftable_remove_rule__(struct ofproto *ofproto, struct classifier *cls,
     if (!list_is_empty(&rule->meter_list_node)) {
         list_remove(&rule->meter_list_node);
     }
+    ovs_rwlock_unlock(&rule->evict);
 }
 
 static void