summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2011-08-15 12:44:20 -0400
committerRobert Morris <[email protected]>2011-08-15 12:44:20 -0400
commit5053dd6a6d2b481bfcddbd91bacc885b9f0e0ff5 (patch)
treeca7d000f9996082466bdfe8c7a0c9667341f2dfa /log.c
parentc95ce31c5978bd43e1f0d34e51a4e3d7bcc41b14 (diff)
downloadxv6-labs-5053dd6a6d2b481bfcddbd91bacc885b9f0e0ff5.tar.gz
xv6-labs-5053dd6a6d2b481bfcddbd91bacc885b9f0e0ff5.tar.bz2
xv6-labs-5053dd6a6d2b481bfcddbd91bacc885b9f0e0ff5.zip
avoid deadlock by calling begin_trans() before locking any inodes
Diffstat (limited to 'log.c')
-rw-r--r--log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/log.c b/log.c
index db36ba9..e9a16c5 100644
--- a/log.c
+++ b/log.c
@@ -124,9 +124,9 @@ static void
recover_from_log(void)
{
read_head();
- install_trans(); // Install all transactions till head
+ install_trans(); // if committed, copy from log to disk
log.lh.n = 0;
- write_head(); // Reclaim log
+ write_head(); // clear the log
}
void