Changeset 24607

Show
Ignore:
Timestamp:
03/27/08 05:48:33 (8 months ago)
Author:
axeld
Message:

* Reverted r22315 as far as free_vnode() is concerned: removing the

vnode from the hash before putting it caused all sorts of problems.

* For example, BFS would trim its preallocations when the vnode is put;

if someone would read that same vnode after it had been removed, but
before BFS could trim it, it would read the old vnode which still
seemed to own the blocks which would subsequently be freed.

* This fixes bug #1914, and should also fix bug #1956.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/system/kernel/fs/vfs.cpp

    r24442 r24607  
    692692        vnode->ref_count = 2; 
    693693 
    694         // The file system has removed the resources of the vnode now, so we can 
    695         // make it available again (and remove the busy vnode from the hash) 
    696         mutex_lock(&sVnodeMutex); 
    697         hash_remove(sVnodeTable, vnode); 
    698         mutex_unlock(&sVnodeMutex); 
    699  
    700694        // TODO: Usually, when the vnode is unreferenced, no one can get hold of the 
    701695        // cache either (i.e. no one can get a cache reference while we're deleting 
     
    713707                } 
    714708        } 
     709 
     710        // The file system has removed the resources of the vnode now, so we can 
     711        // make it available again (and remove the busy vnode from the hash) 
     712        mutex_lock(&sVnodeMutex); 
     713        hash_remove(sVnodeTable, vnode); 
     714        mutex_unlock(&sVnodeMutex); 
    715715 
    716716        // if we have a vm_cache attached, remove it