[haiku-gsoc] Re: bfs deadlock in different path of bfs_free_cookie

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Mon, 18 Aug 2008 22:02:29 +0200 CEST

"Salvatore Benedetto" <emitrax@xxxxxxxxx> wrote:
> By browsing the code the easy way to fix this seems to be
> inverting the two lines below in the Transaction destructor.
>  _UnlockInodes, in fact, starts a new transaction, thus
> trying to reacquire the journal lock after locking the inodes in
> write mode.
> 
>     ~Transaction()
>     {
>         if (fJournal != NULL) {
>             fJournal->Unlock(this, false);
>             _UnlockInodes();
>         }
>     }

Indeed, switching the two lines should do the trick - any transaction 
started in _UnlockInodes() will then reuse the current transaction, 
instead of trying to start a new one.
Nice one!

Bye,
   Axel.


Other related posts: