From b716c3307f9aa679fc888ce2074e66d86d552489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 27 May 2005 00:41:00 +0000 Subject: [PATCH] Removing the cookie must be locked as well, of course. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12854 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/rootfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/fs/rootfs.c b/src/system/kernel/fs/rootfs.c index 3c4155d7ec..0c17129cac 100644 --- a/src/system/kernel/fs/rootfs.c +++ b/src/system/kernel/fs/rootfs.c @@ -644,14 +644,17 @@ rootfs_open_dir(fs_volume _fs, fs_vnode _v, fs_cookie *_cookie) static status_t -rootfs_free_dir_cookie(fs_volume _fs, fs_vnode _v, fs_cookie _cookie) +rootfs_free_dir_cookie(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie) { struct rootfs_dir_cookie *cookie = _cookie; - struct rootfs_vnode *vnode = _v; + struct rootfs_vnode *vnode = _vnode; + struct rootfs *fs = _fs; + mutex_lock(&fs->lock); list_remove_item(&vnode->stream.dir.cookies, cookie); - free(cookie); + mutex_unlock(&fs->lock); + free(cookie); return B_OK; }