projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f487a2e
)
Fix race in dir_reopen().
author
Ben Pfaff
<blp@cs.stanford.edu>
Fri, 19 May 2006 02:45:13 +0000
(
02:45
+0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Fri, 19 May 2006 02:45:13 +0000
(
02:45
+0000)
Thanks to Godmar Back for pointing this out (twice).
solutions/p4.patch
patch
|
blob
|
history
diff --git
a/solutions/p4.patch
b/solutions/p4.patch
index 9e11e251463505459c8bb2df0a4dbd5d0b7f83b5..7ab00465335901ee873027211780765bd3555582 100644
(file)
--- a/
solutions/p4.patch
+++ b/
solutions/p4.patch
@@
-726,7
+726,7
@@
diff -u src/filesys/directory.c~ src/filesys/directory.c
return dir != NULL;
}
-@@ -61,22 +99,3
4
@@ dir_open_root (struct dir **dirp)
+@@ -61,22 +99,3
6
@@ dir_open_root (struct dir **dirp)
return dir_open (inode_open (ROOT_DIR_SECTOR), dirp);
}
@@
-734,7
+734,9
@@
diff -u src/filesys/directory.c~ src/filesys/directory.c
+bool
+dir_reopen (struct dir *dir)
+{
++ lock_acquire (&dir->dir_lock);
+ dir->open_cnt++;
++ lock_release (&dir->dir_lock);
+ return true;
+}
+