[haiku-bugs] Re: [Haiku] #9377: Network Stack Deadlock

  • From: "jackburton" <trac@xxxxxxxxxxxx>
  • Date: Sat, 23 Aug 2014 13:40:12 -0000

#9377: Network Stack Deadlock
----------------------------------------+----------------------------
   Reporter:  jackburton                |      Owner:  axeld
       Type:  bug                       |     Status:  closed
   Priority:  normal                    |  Milestone:  R1
  Component:  Network & Internet/Stack  |    Version:  R1/Development
 Resolution:  fixed                     |   Keywords:
 Blocked By:                            |   Blocking:
Has a Patch:  1                         |   Platform:  All
----------------------------------------+----------------------------

Comment (by jackburton):

 Replying to [comment:11 axeld]:
 > Hm, why didn't you ask me 19 months ago? :-)
 >
 Dunno, maybe I thought it would've been too complicated, and I just wanted
 a quick fix (for myself).

 > By looking over the code, I noticed that Interface::_SetUp() has the
 same issue. I think the best solution would be to use a similar approach
 than the VFS when vnodes are created:
 > - lock all interfaces
 > - create the interface, and put it in there
 > - mark the interface as busy
 > - unlock all interfaces
 > - call into the interface protocol layer as needed (ie.
 interface_up()/interface_down())
 > - lock all interfaces again
 > - remove the busy flag
 > - unlock all interfaces
 >
 > Making the busy flag atomic would save locking all interfaces twice.
 > Of course, get_interface() would then need to check for the busy flag,
 and not return those.
 >
 > If that fails (maybe because the up/down path calls get_interface() on
 itself, and needs it to succeed), the change will get a bit more
 complicated, than this, though.

 Okay, thanks for explaining.

--
Ticket URL: <https://dev.haiku-os.org/ticket/9377#comment:12>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: