patch-2.3.43 linux/fs/ext2/fsync.c

Next file: linux/fs/ext2/inode.c
Previous file: linux/fs/ext2/file.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.42/linux/fs/ext2/fsync.c linux/fs/ext2/fsync.c
@@ -24,8 +24,7 @@
 
 #include <linux/fs.h>
 #include <linux/locks.h>
-
-
+#include <linux/smp_lock.h>
 
 
 #define blocksize	(EXT2_BLOCK_SIZE(inode->i_sb))
@@ -130,6 +129,7 @@
 	int wait, err = 0;
 	struct inode *inode = dentry->d_inode;
 
+	lock_kernel();
 	if (S_ISLNK(inode->i_mode) && !(inode->i_blocks))
 		/*
 		 * Don't sync fast links!
@@ -152,5 +152,6 @@
 	}
 skip:
 	err |= ext2_sync_inode (inode);
+	unlock_kernel();
 	return err ? -EIO : 0;
 }

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