Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308609
b: refs/heads/master
c: d72c727
h: refs/heads/master
i:
  308607: 1b9db5b
v: v3
  • Loading branch information
Bryan Schumaker authored and Trond Myklebust committed May 15, 2012
1 parent d8a1762 commit c9fdc9e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b72e4f42a33137acc037546277a08f407d3c1016
refs/heads/master: d72c727cd9de490f936a41634e34cd4a61ba6dd6
36 changes: 30 additions & 6 deletions trunk/fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ static const struct super_operations nfs_sops = {

#ifdef CONFIG_NFS_V4
static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *);
static int nfs4_validate_mount_data(void *options,
struct nfs_parsed_mount_data *args, const char *dev_name);
static struct dentry *nfs4_try_mount(int flags, const char *dev_name,
struct nfs_parsed_mount_data *data);
static struct dentry *nfs4_mount(struct file_system_type *fs_type,
Expand Down Expand Up @@ -1857,10 +1859,10 @@ static int nfs_parse_devname(const char *dev_name,
* + breaking back: trying proto=udp after proto=tcp, v2 after v3,
* mountproto=tcp after mountproto=udp, and so on
*/
static int nfs_validate_mount_data(void *options,
struct nfs_parsed_mount_data *args,
struct nfs_fh *mntfh,
const char *dev_name)
static int nfs23_validate_mount_data(void *options,
struct nfs_parsed_mount_data *args,
struct nfs_fh *mntfh,
const char *dev_name)
{
struct nfs_mount_data *data = (struct nfs_mount_data *)options;
struct sockaddr *sap = (struct sockaddr *)&args->nfs_server.address;
Expand Down Expand Up @@ -2009,6 +2011,28 @@ static int nfs_validate_mount_data(void *options,
return -EINVAL;
}

#ifdef CONFIG_NFS_V4
static int nfs_validate_mount_data(struct file_system_type *fs_type,
void *options,
struct nfs_parsed_mount_data *args,
struct nfs_fh *mntfh,
const char *dev_name)
{
if (fs_type == &nfs_fs_type)
return nfs23_validate_mount_data(options, args, mntfh, dev_name);
return nfs4_validate_mount_data(options, args, dev_name);
}
#else
static int nfs_validate_mount_data(struct file_system_type *fs_type,
void *options,
struct nfs_parsed_mount_data *args,
struct nfs_fh *mntfh,
const char *dev_name)
{
return nfs23_validate_mount_data(options, args, mntfh, dev_name);
}
#endif

static int nfs_validate_text_mount_data(void *options,
struct nfs_parsed_mount_data *args,
const char *dev_name)
Expand Down Expand Up @@ -2459,7 +2483,7 @@ static struct dentry *nfs_fs_mount(struct file_system_type *fs_type,
goto out;

/* Validate the mount data */
error = nfs_validate_mount_data(raw_data, data, mntfh, dev_name);
error = nfs_validate_mount_data(fs_type, raw_data, data, mntfh, dev_name);
if (error == NFS_TEXT_DATA)
error = nfs_validate_text_mount_data(raw_data, data, dev_name);
if (error < 0) {
Expand Down Expand Up @@ -2866,7 +2890,7 @@ static struct dentry *nfs4_mount(struct file_system_type *fs_type,
goto out;

/* Validate the mount data */
error = nfs4_validate_mount_data(raw_data, data, dev_name);
error = nfs_validate_mount_data(fs_type, raw_data, data, NULL, dev_name);
if (error == NFS_TEXT_DATA)
error = nfs_validate_text_mount_data(raw_data, data, dev_name);
if (error < 0) {
Expand Down

0 comments on commit c9fdc9e

Please sign in to comment.