From 85c5c0b4d015b073a2b3e6ecf3404acaf1524b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 28 Jul 2009 19:58:44 +0000 Subject: [PATCH] * We need to reset fUnwrittenTransactions when we abort a transaction without a sub transaction, or else we would try to continue using it. * It doesn't make any sense to increase fUnwrittenTransactions when _WriteTransactionToLog() failed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31857 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Journal.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.cpp b/src/add-ons/kernel/file_systems/bfs/Journal.cpp index dfa9eb9064..659c70111b 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Journal.cpp @@ -1003,10 +1003,13 @@ status_t Journal::_TransactionDone(bool success) { if (!success) { - if (_HasSubTransaction()) + if (_HasSubTransaction()) { cache_abort_sub_transaction(fVolume->BlockCache(), fTransactionID); - else + // We can continue to use the parent transaction afterwards + } else { cache_abort_transaction(fVolume->BlockCache(), fTransactionID); + fUnwrittenTransactions = 0; + } return B_OK; } @@ -1024,11 +1027,7 @@ Journal::_TransactionDone(bool success) return B_OK; } - status_t status = _WriteTransactionToLog(); - if (status != B_OK) - fUnwrittenTransactions++; - - return status; + return _WriteTransactionToLog(); }