From f8a2f7ce58808a6c1f31c9c1231c50580d236d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 25 Apr 2008 22:44:03 +0000 Subject: [PATCH] * attribute dirs shouldn't be locked out either; I've inverted the type check, so that it now only checks for the type that allow locking. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25168 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/vfs.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 7dec4aa1c0..429c9b6957 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -2523,13 +2523,10 @@ get_new_fd(int type, struct fs_mount *mount, struct vnode *vnode, struct file_descriptor *descriptor; int fd; - // if the vnode is locked, we don't allow creating a new file descriptor for it - // unless it is an attribute that is being created as, in this case, - // the caller is guaranteed to be the lock holder. - // TODO(bga): Is this really true? If I understand this correctly, only - // the lock owner would be able to reach the code here, but I am not - // 100% sure. - if (vnode && vnode->mandatory_locked_by != NULL && type != FDTYPE_ATTR) + // If the vnode is locked, we don't allow creating a new file/directory + // file_descriptor for it + if (vnode && vnode->mandatory_locked_by != NULL + && (type == FDTYPE_FILE || type == FDTYPE_DIR)) return B_BUSY; descriptor = alloc_fd();