summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/super.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 5ef2c71348bd..7c942462d8c6 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2168,7 +2168,10 @@ static int nfs_validate_text_mount_data(void *options,
2168 2168
2169 if (args->version == 4) { 2169 if (args->version == 4) {
2170#if IS_ENABLED(CONFIG_NFS_V4) 2170#if IS_ENABLED(CONFIG_NFS_V4)
2171 port = NFS_PORT; 2171 if (args->nfs_server.protocol == XPRT_TRANSPORT_RDMA)
2172 port = NFS_RDMA_PORT;
2173 else
2174 port = NFS_PORT;
2172 max_namelen = NFS4_MAXNAMLEN; 2175 max_namelen = NFS4_MAXNAMLEN;
2173 max_pathlen = NFS4_MAXPATHLEN; 2176 max_pathlen = NFS4_MAXPATHLEN;
2174 nfs_validate_transport_protocol(args); 2177 nfs_validate_transport_protocol(args);
@@ -2178,8 +2181,11 @@ static int nfs_validate_text_mount_data(void *options,
2178#else 2181#else
2179 goto out_v4_not_compiled; 2182 goto out_v4_not_compiled;
2180#endif /* CONFIG_NFS_V4 */ 2183#endif /* CONFIG_NFS_V4 */
2181 } else 2184 } else {
2182 nfs_set_mount_transport_protocol(args); 2185 nfs_set_mount_transport_protocol(args);
2186 if (args->nfs_server.protocol == XPRT_TRANSPORT_RDMA)
2187 port = NFS_RDMA_PORT;
2188 }
2183 2189
2184 nfs_set_port(sap, &args->nfs_server.port, port); 2190 nfs_set_port(sap, &args->nfs_server.port, port);
2185 2191