* 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:
@@ -1006,7 +1006,8 @@ Journal::Unlock(Transaction* owner, bool success)
|
|||||||
if (fSeparateSubTransactions
|
if (fSeparateSubTransactions
|
||||||
&& recursive_lock_get_recursion(&fLock) == 1)
|
&& recursive_lock_get_recursion(&fLock) == 1)
|
||||||
fSeparateSubTransactions = false;
|
fSeparateSubTransactions = false;
|
||||||
}
|
} else
|
||||||
|
owner->MoveInodesTo(fOwner);
|
||||||
|
|
||||||
recursive_lock_unlock(&fLock);
|
recursive_lock_unlock(&fLock);
|
||||||
return B_OK;
|
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 RemoveInode(Inode* inode);
|
||||||
|
|
||||||
void UnlockInodes(bool success);
|
void UnlockInodes(bool success);
|
||||||
|
void MoveInodesTo(Transaction* transaction);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Transaction(const Transaction& other);
|
Transaction(const Transaction& other);
|
||||||
|
|||||||
Reference in New Issue
Block a user