Thanks for checking! However, maybe it should also use a recursive mutex; couldn't it have the same problem described in the comment in stp.c that causes STP to use a recursive mutex?
/* We need a recursive mutex because stp_send_bpdu() could loop back * into the stp module through a patch port. This happens * intentionally as part of the unit tests. Ideally we'd ditch * the call back function, but for now this is what we have. */ On Fri, May 20, 2016 at 10:25:50AM -0700, Jarno Rajahalme wrote: > I checked to see if lib/rstp.c has the same issue, but it has a static > initializer for its mutex, so I guess not. > > Jarno > > > On May 20, 2016, at 10:06 AM, Ben Pfaff <b...@ovn.org> wrote: > > > > On Fri, May 20, 2016 at 05:30:25PM +0200, Quentin Monnet wrote: > >> Hi Ben, > >> > >> 2016-05-20 (07:49 -0700) ~ Ben Pfaff > >>> The stp/tcn command, which locks the mutex, was being registered without > >>> initializing the mutex, so calling stp/tcn before STP was enabled on the > >>> switch caused a crash. This commit fixes the bug by initializing the > >>> mutex > >>> at the same time we register the stp/tcn command. > >>> > >>> Reported-by: Ding Zhi <zhi.d...@6wind.com> > >>> Reported-at: http://openvswitch.org/pipermail/dev/2016-May/071381.html > >>> Signed-off-by: Ben Pfaff <b...@ovn.org> > >>> --- > >>> AUTHORS | 1 + > >>> lib/stp.c | 27 +++++++++++++++------------ > >>> 2 files changed, 16 insertions(+), 12 deletions(-) > >>> > >>> diff --git a/AUTHORS b/AUTHORS > >>> index 39ac60b..e39c2f0 100644 > >>> --- a/AUTHORS > >>> +++ b/AUTHORS > >>> @@ -300,6 +300,7 @@ David Palma pa...@onesource.pt > >>> Derek Cormier derek.corm...@lab.ntt.co.jp > >>> Dhaval Badiani dbadi...@vmware.com > >>> DK Moon dkm...@nicira.com > >>> +Dong Zhi zhi.d...@6wind.com > >> > >> Please note that there is a typo here in the name of the author (“Ding”). > > > > Oops. Fixed. > > > >>> Edwin Chiu ec...@vmware.com <mailto:ec...@vmware.com> > >>> Eivind Bulie Haanaes > >>> Enas Ahmad enas.ah...@kaust.edu.sa > >>> <mailto:enas.ah...@kaust.edu.sa> > >>> diff --git a/lib/stp.c b/lib/stp.c > >>> index 0f92ed1..ecef012 100644 > >>> […] > >> > >> This patch does address the issue of my previous email ( > >> http://openvswitch.org/pipermail/dev/2016-May/071381.html > >> <http://openvswitch.org/pipermail/dev/2016-May/071381.html> ). Thanks! > >> > >> Test-by: Quentin Monnet <quentin.mon...@6wind.com > >> <mailto:quentin.mon...@6wind.com>> > > > > Thanks, I applied this to master, branch-2.5, branch-2.4, and > > branch-2.3. > > _______________________________________________ > > dev mailing list > > dev@openvswitch.org <mailto:dev@openvswitch.org> > > http://openvswitch.org/mailman/listinfo/dev > > <http://openvswitch.org/mailman/listinfo/dev> _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev