[haiku-gsoc] Re: BFS bug #2

"Salvatore Benedetto" <emitrax@xxxxxxxxx> wrote:
> I think I hit a second bug while checking out haiku source code.
> Didn't take any screenshots this time, but this is what happened:
> 
> - svn calls bfs_rename, which first lock the volume and then try to 
> acquire
> the journal lock by creating a Transaction object.
> 
> - The daemon thread on the other hand, somehow calls the bfs_unlink 
> function
> (btw I didn't bother to write down its whole stack trace because I
> thought I'd figure out how
> it got to bfs_unlink, but I couldn't, so if any of you can shine some
> light on this I'd really
> appreciate it). The bfs_unlink function first locks the journal area
> by creating a transaction
> and then by calling Inode::Remove tries to acquire the volume lock,
> which is already held
> by svn, thus the deadlock in the file system.
> 
> I'm fixing it now. Let me know if you have any suggestions about how 
> to fix it.

Nice one! The volume lock should be the outer lock, so the caller of 
Inode::Remove() should make sure it's locked.

Bye,
   Axel.


Other related posts: