ofproto-dpif-xlate: Avoid recursively taking read side of ofgroup rwlock.
authorBen Pfaff <blp@nicira.com>
Sat, 22 Feb 2014 00:27:00 +0000 (16:27 -0800)
committerBen Pfaff <blp@nicira.com>
Sat, 22 Feb 2014 00:27:00 +0000 (16:27 -0800)
With glibc, rwlocks by default allow recursive read-locking even if a
thread is blocked waiting for the write-lock.  POSIX allows such attempts
to deadlock, and it appears that the libc used in NetBSD, at least, does
deadlock.  ofproto-dpif-xlate could take the ofgroup rwlock recursively if
an ofgroup's actions caused the ofgroup to be executed again.  This commit
avoids that issue by preventing recursive translation of groups (the same
group or another group).  This is not the most user friendly solution,
but OpenFlow allows this restriction, and we can always remove the
restriction later (probably requiring more complicated code) if it
proves to be a real problem to real users.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>

No differences found