From 11e38cc1d99251fcf7f415770c3d898fc0d27ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 5 Jan 2004 01:03:14 +0000 Subject: [PATCH] Applied the unmount() fix from NewOS change 1906. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5906 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/fs/vfs.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kernel/core/fs/vfs.cpp b/src/kernel/core/fs/vfs.cpp index 50cb66d5e7..c25ddf7358 100755 --- a/src/kernel/core/fs/vfs.cpp +++ b/src/kernel/core/fs/vfs.cpp @@ -3386,8 +3386,9 @@ fs_unmount(char *path, bool kernel) goto err; } - /* grab the vnode master mutex to keep someone from creating a vnode - while we're figuring out if we can continue */ + /* grab the vnode master mutex to keep someone from creating + * a vnode while we're figuring out if we can continue + */ mutex_lock(&sVnodeMutex); /* simulate the root vnode having it's refcount decremented */ @@ -3415,6 +3416,9 @@ fs_unmount(char *path, bool kernel) } mount->unmounting = true; + /* add 2 back to the root vnode's ref */ + mount->root_vnode->ref_count += 2; + mutex_unlock(&sVnodeMutex); mount->covers_vnode->covered_by = NULL;