Instead of waiting forever, get_vnode() will now fail after 3 seconds if the

vnode is not becoming unbusy (right now it even panics, but that can be removed
later on).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17161 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-04-18 13:55:47 +00:00
parent cd0ea6ff0f
commit fde87a1094
+7 -2
View File
@@ -799,12 +799,17 @@ get_vnode(mount_id mountID, vnode_id vnodeID, struct vnode **_vnode, int reenter
mutex_lock(&sVnodeMutex);
int32 tries = 300;
// try for 3 secs
restart:
struct vnode *vnode = lookup_vnode(mountID, vnodeID);
if (vnode && vnode->busy) {
// ToDo: this is an endless loop if the vnode is not
// becoming unbusy anymore (for whatever reason)
mutex_unlock(&sVnodeMutex);
if (--tries < 0) {
// vnode doesn't seem to become unbusy
panic("vnode %ld.%Ld is not becoming unbusy!\n", mountID, vnodeID);
return B_BUSY;
}
snooze(10000); // 10 ms
mutex_lock(&sVnodeMutex);
goto restart;