* When a reentered fs function reuses a transaction of its caller, the

Transaction::UnlockInodes() method was never called, leading to bug #4155.
* In order to make sure that inodes are still going to be reverted, we actually
  need to move them into the parent transaction which we now do. This should
  fix #4155.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31952 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-07-29 23:46:56 +00:00
parent ca39f8d89f
commit 65e04b057d
2 changed files with 14 additions and 1 deletions
@@ -1006,7 +1006,8 @@ Journal::Unlock(Transaction* owner, bool success)
if (fSeparateSubTransactions
&& recursive_lock_get_recursion(&fLock) == 1)
fSeparateSubTransactions = false;
}
} else
owner->MoveInodesTo(fOwner);
recursive_lock_unlock(&fLock);
return B_OK;
@@ -1202,3 +1203,14 @@ Transaction::UnlockInodes(bool success)
}
}
/*! Move the inodes into the parent transaction. This is needed only to make
sure they will still be reverted in case the transaction is aborted.
*/
void
Transaction::MoveInodesTo(Transaction* transaction)
{
while (Inode* inode = fLockedInodes.RemoveHead()) {
transaction->fLockedInodes.Add(inode);
}
}
@@ -180,6 +180,7 @@ public:
void RemoveInode(Inode* inode);
void UnlockInodes(bool success);
void MoveInodesTo(Transaction* transaction);
private:
Transaction(const Transaction& other);