NFS: Fix a write request leak in nfs_invalidate_page()
[linux-block.git] / fs / ncpfs / ioctl.c
index a89ac84a8241a53d4e260deda2ad7d7f8c675255..c67b4bdcf719d0e02e86272962f22156c1f5ff25 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/highuid.h>
 #include <linux/smp_lock.h>
 #include <linux/vmalloc.h>
+#include <linux/sched.h>
 
 #include <linux/ncp_fs.h>
 
@@ -35,7 +36,7 @@ static int
 ncp_get_fs_info(struct ncp_server * server, struct file *file,
                struct ncp_fs_info __user *arg)
 {
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file->f_path.dentry->d_inode;
        struct ncp_fs_info info;
 
        if ((file_permission(file, MAY_WRITE) != 0)
@@ -65,7 +66,7 @@ static int
 ncp_get_fs_info_v2(struct ncp_server * server, struct file *file,
                   struct ncp_fs_info_v2 __user * arg)
 {
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file->f_path.dentry->d_inode;
        struct ncp_fs_info_v2 info2;
 
        if ((file_permission(file, MAY_WRITE) != 0)
@@ -136,7 +137,7 @@ static int
 ncp_get_compat_fs_info_v2(struct ncp_server * server, struct file *file,
                   struct compat_ncp_fs_info_v2 __user * arg)
 {
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file->f_path.dentry->d_inode;
        struct compat_ncp_fs_info_v2 info2;
 
        if ((file_permission(file, MAY_WRITE) != 0)
@@ -726,7 +727,7 @@ outrel:
                                struct compat_ncp_privatedata_ioctl user32;
                                user32.len = user.len;
                                user32.data = (unsigned long) user.data;
-                               if (copy_to_user(&user32, argp, sizeof(user32)))
+                               if (copy_to_user(argp, &user32, sizeof(user32)))
                                        return -EFAULT;
                        } else
 #endif
@@ -824,7 +825,7 @@ outrel:
 #ifdef CONFIG_COMPAT
 long ncp_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file->f_path.dentry->d_inode;
        int ret;
 
        lock_kernel();