Merge to Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.13-vs2...
[linux-2.6.git] / fs / nfsctl.c
index 12472dd..a5a18d4 100644 (file)
@@ -5,6 +5,7 @@
  *
  */
 #include <linux/config.h>
+#include <linux/types.h>
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/sunrpc/svc.h>
@@ -13,6 +14,7 @@
 #include <linux/linkage.h>
 #include <linux/namei.h>
 #include <linux/mount.h>
+#include <linux/syscalls.h>
 #include <asm/uaccess.h>
 
 /*
@@ -32,6 +34,7 @@ static struct file *do_open(char *name, int flags)
        nd.dentry = dget(nd.mnt->mnt_root);
        nd.last_type = LAST_ROOT;
        nd.flags = 0;
+       nd.depth = 0;
 
        error = path_walk(name, &nd);
        if (error)
@@ -95,12 +98,10 @@ asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *r
        if (copy_from_user(&version, &arg->ca_version, sizeof(int)))
                return -EFAULT;
 
-       if (version != NFSCTL_VERSION) {
-               printk(KERN_WARNING "nfsd: incompatible version in syscall.\n");
+       if (version != NFSCTL_VERSION)
                return -EINVAL;
-       }
 
-       if (cmd < 0 || cmd >= sizeof(map)/sizeof(map[0]) || !map[cmd].name)
+       if (cmd < 0 || cmd >= ARRAY_SIZE(map) || !map[cmd].name)
                return -EINVAL;
 
        file = do_open(map[cmd].name, map[cmd].rsize ? O_RDWR : O_WRONLY);