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:
@@ -799,12 +799,17 @@ get_vnode(mount_id mountID, vnode_id vnodeID, struct vnode **_vnode, int reenter
|
|||||||
|
|
||||||
mutex_lock(&sVnodeMutex);
|
mutex_lock(&sVnodeMutex);
|
||||||
|
|
||||||
|
int32 tries = 300;
|
||||||
|
// try for 3 secs
|
||||||
restart:
|
restart:
|
||||||
struct vnode *vnode = lookup_vnode(mountID, vnodeID);
|
struct vnode *vnode = lookup_vnode(mountID, vnodeID);
|
||||||
if (vnode && vnode->busy) {
|
if (vnode && vnode->busy) {
|
||||||
// ToDo: this is an endless loop if the vnode is not
|
|
||||||
// becoming unbusy anymore (for whatever reason)
|
|
||||||
mutex_unlock(&sVnodeMutex);
|
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
|
snooze(10000); // 10 ms
|
||||||
mutex_lock(&sVnodeMutex);
|
mutex_lock(&sVnodeMutex);
|
||||||
goto restart;
|
goto restart;
|
||||||
|
|||||||
Reference in New Issue
Block a user