Don't create anything in a removed directory. Axel, please review. I

don't see how the locking in Remove()/Create() works.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25404 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-09 21:21:22 +00:00
parent 156c744335
commit 536f5d515a

View File

@ -2320,6 +2320,15 @@ Inode::Create(Transaction &transaction, Inode *parent, const char *name,
WriteLocked locker(parent != NULL ? &parent->Lock() : NULL); WriteLocked locker(parent != NULL ? &parent->Lock() : NULL);
// the parent directory is locked during the whole inode creation // the parent directory is locked during the whole inode creation
if (parent != NULL && parent->IsDirectory()) {
// don't create anything in removed directories
bool removed;
if (get_vnode_removed(volume->FSVolume(), parent->ID(), &removed)
!= B_OK || removed) {
RETURN_ERROR(B_ENTRY_NOT_FOUND);
}
}
if (tree != NULL) { if (tree != NULL) {
// Does the file already exist? // Does the file already exist?
off_t offset; off_t offset;