diff options
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index fa517ae9207f..2426e713b77f 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1054,10 +1054,11 @@ static int nfs_validate_mount_data(void *options, | |||
1054 | { | 1054 | { |
1055 | struct nfs_mount_data *data = (struct nfs_mount_data *)options; | 1055 | struct nfs_mount_data *data = (struct nfs_mount_data *)options; |
1056 | 1056 | ||
1057 | memset(args, 0, sizeof(*args)); | ||
1058 | |||
1057 | if (data == NULL) | 1059 | if (data == NULL) |
1058 | goto out_no_data; | 1060 | goto out_no_data; |
1059 | 1061 | ||
1060 | memset(args, 0, sizeof(*args)); | ||
1061 | args->flags = (NFS_MOUNT_VER3 | NFS_MOUNT_TCP); | 1062 | args->flags = (NFS_MOUNT_VER3 | NFS_MOUNT_TCP); |
1062 | args->rsize = NFS_MAX_FILE_IO_SIZE; | 1063 | args->rsize = NFS_MAX_FILE_IO_SIZE; |
1063 | args->wsize = NFS_MAX_FILE_IO_SIZE; | 1064 | args->wsize = NFS_MAX_FILE_IO_SIZE; |
@@ -1474,6 +1475,11 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags, | |||
1474 | error = PTR_ERR(mntroot); | 1475 | error = PTR_ERR(mntroot); |
1475 | goto error_splat_super; | 1476 | goto error_splat_super; |
1476 | } | 1477 | } |
1478 | if (mntroot->d_inode->i_op != &nfs_dir_inode_operations) { | ||
1479 | dput(mntroot); | ||
1480 | error = -ESTALE; | ||
1481 | goto error_splat_super; | ||
1482 | } | ||
1477 | 1483 | ||
1478 | s->s_flags |= MS_ACTIVE; | 1484 | s->s_flags |= MS_ACTIVE; |
1479 | mnt->mnt_sb = s; | 1485 | mnt->mnt_sb = s; |
@@ -1531,10 +1537,11 @@ static int nfs4_validate_mount_data(void *options, | |||
1531 | struct nfs4_mount_data *data = (struct nfs4_mount_data *)options; | 1537 | struct nfs4_mount_data *data = (struct nfs4_mount_data *)options; |
1532 | char *c; | 1538 | char *c; |
1533 | 1539 | ||
1540 | memset(args, 0, sizeof(*args)); | ||
1541 | |||
1534 | if (data == NULL) | 1542 | if (data == NULL) |
1535 | goto out_no_data; | 1543 | goto out_no_data; |
1536 | 1544 | ||
1537 | memset(args, 0, sizeof(*args)); | ||
1538 | args->rsize = NFS_MAX_FILE_IO_SIZE; | 1545 | args->rsize = NFS_MAX_FILE_IO_SIZE; |
1539 | args->wsize = NFS_MAX_FILE_IO_SIZE; | 1546 | args->wsize = NFS_MAX_FILE_IO_SIZE; |
1540 | args->timeo = 600; | 1547 | args->timeo = 600; |