From 8f7ec006cbe74442fc0a6ef2cc0fbf733717b4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 1 Apr 2012 13:04:36 +0200 Subject: [PATCH] We need to remove the tree from the transaction. Fixes #3159. * The tree does keep a reference to the inode as well as long as it is part of a transaction. * Even if it wouldn't have done it (and would not have triggered the panic), Haiku would likely have crashed, as the inode (and therefore its tree) was already deleted at the time when the transaction discarded its listeners. --- src/add-ons/kernel/file_systems/bfs/Inode.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp index dd03c2294a..8e0c0f0dac 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp @@ -176,6 +176,9 @@ InodeAllocator::~InodeAllocator() fInode->Node().flags &= ~HOST_ENDIAN_TO_BFS_INT32(INODE_IN_USE); // this unblocks any pending bfs_read_vnode() calls fInode->Free(*fTransaction); + + if (fInode->fTree != NULL) + fTransaction->RemoveListener(fInode->fTree); fTransaction->RemoveListener(fInode); remove_vnode(volume->FSVolume(), fInode->ID());