patch-2.4.0-test4 linux/fs/ext2/file.c

Next file: linux/fs/file_table.c
Previous file: linux/fs/devfs/base.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/fs/ext2/file.c linux/fs/ext2/file.c
@@ -20,6 +20,7 @@
 
 #include <linux/fs.h>
 #include <linux/sched.h>
+#include <linux/smp_lock.h>
 
 static loff_t ext2_file_lseek(struct file *, loff_t, int);
 static int ext2_open_file (struct inode *, struct file *);
@@ -73,8 +74,11 @@
  */
 static int ext2_release_file (struct inode * inode, struct file * filp)
 {
-	if (filp->f_mode & FMODE_WRITE)
+	if (filp->f_mode & FMODE_WRITE) {
+		lock_kernel();
 		ext2_discard_prealloc (inode);
+		unlock_kernel();
+	}
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)