From fab9439d61607e2ee013fe91280c2258cc9a909f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 16 May 2006 20:10:31 +0000 Subject: [PATCH] file_close needs fs_lock. --- solutions/p2.patch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solutions/p2.patch b/solutions/p2.patch index 90faed7..83d91fe 100644 --- a/solutions/p2.patch +++ b/solutions/p2.patch @@ -491,7 +491,7 @@ diff -u src/userprog/process.c~ src/userprog/process.c diff -u src/userprog/syscall.c~ src/userprog/syscall.c --- src/userprog/syscall.c~ 2004-09-26 14:15:17.000000000 -0700 +++ src/userprog/syscall.c 2005-06-08 13:45:28.000000000 -0700 -@@ -1,20 +1,480 @@ +@@ -1,20 +1,482 @@ #include "userprog/syscall.h" #include +#include @@ -972,7 +972,9 @@ diff -u src/userprog/syscall.c~ src/userprog/syscall.c + struct file_descriptor *fd; + fd = list_entry (e, struct file_descriptor, elem); + next = list_next (e); ++ lock_acquire (&fs_lock); + file_close (fd->file); ++ lock_release (&fs_lock); + free (fd); + } +} -- 2.30.2