patch-2.4.0-test3 linux/fs/efs/symlink.c

Next file: linux/fs/exec.c
Previous file: linux/fs/dquot.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/fs/efs/symlink.c linux/fs/efs/symlink.c
@@ -9,6 +9,7 @@
 #include <linux/string.h>
 #include <linux/efs_fs.h>
 #include <linux/pagemap.h>
+#include <linux/smp_lock.h>
 
 static int efs_symlink_readpage(struct file *file, struct page *page)
 {
@@ -22,6 +23,7 @@
 	if (size > 2 * EFS_BLOCKSIZE)
 		goto fail;
   
+	lock_kernel();
 	/* read first 512 bytes of link target */
 	err = -EIO;
 	bh = bread(inode->i_dev, efs_bmap(inode, 0), EFS_BLOCKSIZE);
@@ -37,11 +39,13 @@
 		brelse(bh);
 	}
 	link[size] = '\0';
+	unlock_kernel();
 	SetPageUptodate(page);
 	kunmap(page);
 	UnlockPage(page);
 	return 0;
 fail:
+	unlock_kernel();
 	SetPageError(page);
 	kunmap(page);
 	UnlockPage(page);

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