From: Ben Pfaff Date: Tue, 16 May 2006 20:10:31 +0000 (+0000) Subject: file_close needs fs_lock. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab9439d61607e2ee013fe91280c2258cc9a909f;p=pintos-anon file_close needs fs_lock. --- 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); + } +}