aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index fa517ae9207f..0b0c72a072ff 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_SB(s)->nfs_client->rpc_ops->dir_inode_ops) {
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;
@@ -1819,6 +1826,11 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
1819 error = PTR_ERR(mntroot); 1826 error = PTR_ERR(mntroot);
1820 goto error_splat_super; 1827 goto error_splat_super;
1821 } 1828 }
1829 if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) {
1830 dput(mntroot);
1831 error = -ESTALE;
1832 goto error_splat_super;
1833 }
1822 1834
1823 s->s_flags |= MS_ACTIVE; 1835 s->s_flags |= MS_ACTIVE;
1824 mnt->mnt_sb = s; 1836 mnt->mnt_sb = s;
@@ -1893,6 +1905,11 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
1893 error = PTR_ERR(mntroot); 1905 error = PTR_ERR(mntroot);
1894 goto error_splat_super; 1906 goto error_splat_super;
1895 } 1907 }
1908 if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) {
1909 dput(mntroot);
1910 error = -ESTALE;
1911 goto error_splat_super;
1912 }
1896 1913
1897 s->s_flags |= MS_ACTIVE; 1914 s->s_flags |= MS_ACTIVE;
1898 mnt->mnt_sb = s; 1915 mnt->mnt_sb = s;