* 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
This commit is contained in:
Axel Dörfler 2008-04-04 13:54:18 +00:00
parent 5ebf78f405
commit 0bb7a9c0ca
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}