From a9d0f0e57673e4d4d8e5208e97c649a0b41cc260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 26 May 2005 08:06:30 +0000 Subject: [PATCH] Fixed a minor bug in the file system check code: it was not always correctly determined if the parent directory had the wrong type. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12825 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/file_systems/bfs/BlockAllocator.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index b724242b52..e470f176b8 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -1,6 +1,6 @@ /* BlockAllocator - block bitmap handling and allocation policies * - * Copyright 2001-2004, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2001-2005, Axel Dörfler, axeld@pinc-software.de. * This file may be used under the terms of the MIT License. */ @@ -994,10 +994,11 @@ BlockAllocator::CheckNextNode(check_control *control) // Check for the correct mode of the node (if the mode of the // file don't fit to its parent, there is a serious problem) - if ((cookie->parent_mode & S_ATTR_DIR && !inode->IsAttribute()) - || (cookie->parent_mode & S_INDEX_DIR && !inode->IsIndex()) - || ((cookie->parent_mode & S_DIRECTORY | S_ATTR_DIR | S_INDEX_DIR) == S_DIRECTORY - && inode->Mode() & (S_ATTR | S_ATTR_DIR | S_INDEX_DIR))) { + if (((cookie->parent_mode & S_ATTR_DIR) != 0 && !inode->IsAttribute()) + || ((cookie->parent_mode & S_INDEX_DIR) != 0 && !inode->IsIndex()) + || ((cookie->parent_mode & (S_DIRECTORY | S_ATTR_DIR | S_INDEX_DIR)) + == S_DIRECTORY + && (inode->Mode() & (S_ATTR | S_ATTR_DIR | S_INDEX_DIR)) != 0)) { FATAL(("inode at %Ld is of wrong type: %o (parent %o at %Ld)!\n", inode->BlockNumber(), inode->Mode(), cookie->parent_mode, cookie->parent->BlockNumber()));