NFS: Restore missing hunk in NFS mount option parser
[pandora-kernel.git] / fs / nfs / super.c
index 47cf83e..e9b2017 100644 (file)
@@ -374,8 +374,6 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
        };
        int error;
 
-       lock_kernel();
-
        error = server->nfs_client->rpc_ops->statfs(server, fh, &res);
        if (error < 0)
                goto out_err;
@@ -407,12 +405,10 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 
        buf->f_namelen = server->namelen;
 
-       unlock_kernel();
        return 0;
 
  out_err:
        dprintk("%s: statfs error = %d\n", __func__, -error);
-       unlock_kernel();
        return error;
 }
 
@@ -1283,6 +1279,12 @@ static int nfs_parse_mount_options(char *raw,
                }
        }
 
+       if (errors > 0) {
+               dfprintk(MOUNT, "NFS: parsing encountered %d error%s\n",
+                               errors, (errors == 1 ? "" : "s"));
+               if (!sloppy)
+                       return 0;
+       }
        return 1;
 
 out_nomem:
@@ -1722,9 +1724,9 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
         * ones were explicitly specified. Fall back to legacy behavior and
         * just return success.
         */
-       if ((nfsvers == 4 && options4->version == 1) ||
-           (nfsvers <= 3 && options->version >= 1 &&
-            options->version <= 6))
+       if ((nfsvers == 4 && (!options4 || options4->version == 1)) ||
+           (nfsvers <= 3 && (!options || (options->version >= 1 &&
+                                          options->version <= 6))))
                return 0;
 
        data = kzalloc(sizeof(*data), GFP_KERNEL);