patch-pre2.0.11 linux/fs/ncpfs/file.c

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

diff -u --recursive --new-file pre2.0.10/linux/fs/ncpfs/file.c linux/fs/ncpfs/file.c
@@ -15,6 +15,7 @@
 #include <linux/stat.h>
 #include <linux/mm.h>
 #include <linux/ncp_fs.h>
+#include <linux/locks.h>
 #include "ncplib_kernel.h"
 #include <linux/malloc.h>
 
@@ -44,8 +45,10 @@
 
         DPRINTK("ncp_make_open: dirent->opened = %d\n", finfo->opened);
 
+	lock_super(i->i_sb);
         if (finfo->opened == 0)
 	{
+		finfo->access = -1;
                 /* tries max. rights */
 		if (ncp_open_create_file_or_subdir(NCP_SERVER(i),
 						   NULL, NULL,
@@ -63,11 +66,9 @@
 		{
 			finfo->access = O_RDONLY;
 		}
-		else
-		{
-			return -EACCES;
-		}
         }
+
+	unlock_super(i->i_sb);
 
         if (   ((right == O_RDONLY) && (   (finfo->access == O_RDONLY)
                                         || (finfo->access == O_RDWR)))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this