[haiku-gsoc] Re: BFS bug #2

"Salvatore Benedetto" <emitrax@xxxxxxxxx> wrote:
> I'm fixing it now. Let me know if you have any suggestions about how 
> to fix it.

On second thought, it's not that easy to do what I just suggested; 
Inode::_MakeSpaceForSmallData() calls Inode::Remove(), and it's 
impractical to always lock the volume lock before that.
Instead, I have two different suggestions:
1) the simple one: get rid of the volume lock in remove/rename, and 
start the transaction in rename earlier (at the place where the volume 
is locked now)
2) the needlessly complex one: make the journal lock an r/w lock, and 
make rename read lock it before actually starting a transaction (a 
transaction would always write lock).

IMO 1) is the way to go, since 2) would only be an optimization for the 
error case, and can thus be neglected.

Bye,
   Axel.


Other related posts: