* The inode list link was supposed to be secured by the journal log - so it was
definitely not a good idea to move _UnlockInodes() after the Journal::Unlock() call (which was done to achieve a revertable inode). * Instead, Journal::Unlock() is now responsible for calling the now public Transaction::UnlockInodes(), and always does this at the right time while holding the journal log. * While I don't understand how #4155 can happen, this bug should be the one that caused it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31944 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -996,6 +996,8 @@ Journal::Unlock(Transaction* owner, bool success)
|
||||
status_t status = _TransactionDone(success);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
fOwner->UnlockInodes(success);
|
||||
}
|
||||
|
||||
fTimestamp = system_time();
|
||||
@@ -1178,7 +1180,7 @@ Transaction::RemoveInode(Inode* inode)
|
||||
|
||||
|
||||
void
|
||||
Transaction::_UnlockInodes(bool success)
|
||||
Transaction::UnlockInodes(bool success)
|
||||
{
|
||||
while (Inode* inode = fLockedInodes.RemoveHead()) {
|
||||
if (success) {
|
||||
|
||||
@@ -110,10 +110,8 @@ public:
|
||||
|
||||
~Transaction()
|
||||
{
|
||||
if (fJournal != NULL) {
|
||||
if (fJournal != NULL)
|
||||
fJournal->Unlock(this, false);
|
||||
_UnlockInodes(false);
|
||||
}
|
||||
}
|
||||
|
||||
status_t Start(Volume* volume, off_t refBlock);
|
||||
@@ -124,10 +122,8 @@ public:
|
||||
status_t status = B_OK;
|
||||
if (fJournal != NULL) {
|
||||
status = fJournal->Unlock(this, true);
|
||||
if (status == B_OK) {
|
||||
_UnlockInodes(true);
|
||||
if (status == B_OK)
|
||||
fJournal = NULL;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@@ -183,13 +179,13 @@ public:
|
||||
void AddInode(Inode* inode);
|
||||
void RemoveInode(Inode* inode);
|
||||
|
||||
void UnlockInodes(bool success);
|
||||
|
||||
private:
|
||||
Transaction(const Transaction& other);
|
||||
Transaction& operator=(const Transaction& other);
|
||||
// no implementation
|
||||
|
||||
void _UnlockInodes(bool success);
|
||||
|
||||
Journal* fJournal;
|
||||
InodeList fLockedInodes;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user