From 0bb7a9c0ca0743114de10ceebd5b9ee6d391afc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 4 Apr 2008 13:54:18 +0000 Subject: [PATCH] * Journal::_TransactionWritten() updated Volume::LogStart() before it actually wrote the super block, so there was a race condition with what _WriteTransactionToLog() assumed was already written there (if it managed to write the log entry before the super block was written by _TransactionWritten(), and a reboot happened just then, the log start could point to an invalid log entry). Not very likely, but it could happen. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24791 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Journal.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.cpp b/src/add-ons/kernel/file_systems/bfs/Journal.cpp index 4f1dbb6c4a..a5a656f0a5 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Journal.cpp @@ -567,8 +567,6 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void *_logEntry) // update the super block, and change the disk's state, if necessary if (update) { - journal->fVolume->LogStart() = superBlock.log_start; - if (superBlock.log_start == superBlock.log_end) superBlock.flags = SUPER_BLOCK_DISK_CLEAN; @@ -577,6 +575,8 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void *_logEntry) FATAL(("_TransactionWritten: could not write back super block: %s\n", strerror(status))); } + + journal->fVolume->LogStart() = superBlock.log_start; } }