From 541959e00aa2b8b1a9314c54f8ee152a3b93136a Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 18 Jul 2008 02:07:08 +0000 Subject: [PATCH] Add (not really necessary) locking of the sMountMutex in case of KDEBUG to keep the assert in find_mount() happy. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26484 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/vfs.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 2ea6919d5d..52ccf61436 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -6500,7 +6500,11 @@ fs_unmount(char *path, dev_t mountID, uint32 flags, bool kernel) RecursiveLocker mountOpLocker(sMountOpLock); + // this lock is not strictly necessary, but here in case of KDEBUG + // to keep the ASSERT in find_mount() working. + KDEBUG_ONLY(mutex_lock(&sMountMutex)); mount = find_mount(path != NULL ? vnode->device : mountID); + KDEBUG_ONLY(mutex_unlock(&sMountMutex)); if (mount == NULL) { panic("fs_unmount: find_mount() failed on root vnode @%p of mount\n", vnode);