[ovs-dev] [PATCH 5/7] datapath: Don't check for RCU in free_buckets in table.

Jesse Gross jesse at nicira.com
Wed Dec 29 23:41:33 UTC 2010


free_buckets() is only called in places where the lifetime of its
container has ended: on allocation failure and on deletion after
a grace period.  If the container can no longer be referenced then
neither can the buckets, so it is safe to directly free them.
sparse complains if the pointer is directly dereferenced and lockdep
complains if the RCU functions are used without some type of lock,
both of which are fine in this case.  This adds an explicit cast to
avoid the complaints.

Found with lockdep.

Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 datapath/table.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/datapath/table.c b/datapath/table.c
index 5c1b82a..b54534a 100644
--- a/datapath/table.c
+++ b/datapath/table.c
@@ -51,7 +51,7 @@ static void free_buckets(struct tbl_bucket __rcu ***l1,
 		unsigned int j;
 
 		for (j = 0; j < TBL_L2_SIZE; j++) {
-			struct tbl_bucket *bucket = rcu_dereference(l2[j]);
+			struct tbl_bucket *bucket = (struct tbl_bucket __force *)l2[j];
 			if (!bucket)
 				continue;
 
-- 
1.7.1





More information about the dev mailing list