[haiku-gsoc] Re: BFS bug #2

"Salvatore Benedetto" <emitrax@xxxxxxxxx> wrote:
> The only thing I didn't understand, thus the questions, is how can 
> you just
> remove the volume lock in the bfs_rename function and move up the
> transaction lock.

That question would have been perfectly fine, but that wasn't the one 
you asked. Anyway, I just had to mention it, because it bugged me one 
time to often. Reading mails thoroughly is always a good idea.

> It looks to me as if the transaction lock can substitute the volume
> lock purpose in the first part of the bfs_rename function, but now I 
> see that not
> modification can be made to the volume
> unless the transaction lock is held. At least that's the only
> explanation I could come up with.

Exactly; the volume lock was more or less a left-over from the past. 
The only purpose it still had at that point was to be able to delay 
getting the journal lock.
That does slightly improve the concurrency in the read path (ie. for a 
short moment only), but it's probably not worth to work-around this 
problem (by introducing a read/write lock for the journal, as I 
suggested).
Transactions are always serialized, and all meta-data changes require 
you to have a transaction; therefore, it's a good substitute for the 
volume lock in that place.

Bye,
   Axel.


Other related posts: