Skip to content

Commit a67d18f

Browse files
Tom TalpeyTrond Myklebust
authored andcommitted
NFS: load the rpc/rdma transport module automatically
When mounting an NFS/RDMA server with the "-o proto=rdma" or "-o rdma" options, attempt to dynamically load the necessary "xprtrdma" client transport module. Doing so improves usability, while avoiding a static module dependency and any unnecesary resources. Signed-off-by: Tom Talpey <tmtalpey@gmail.com> Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent 441e3e2 commit a67d18f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎fs/nfs/super.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,7 @@ static int nfs_parse_mount_options(char *raw,
10181018
case Opt_rdma:
10191019
mnt->flags |= NFS_MOUNT_TCP; /* for side protocols */
10201020
mnt->nfs_server.protocol = XPRT_TRANSPORT_RDMA;
1021+
xprt_load_transport(p);
10211022
break;
10221023
case Opt_acl:
10231024
mnt->flags &= ~NFS_MOUNT_NOACL;
@@ -1205,20 +1206,21 @@ static int nfs_parse_mount_options(char *raw,
12051206
/* vector side protocols to TCP */
12061207
mnt->flags |= NFS_MOUNT_TCP;
12071208
mnt->nfs_server.protocol = XPRT_TRANSPORT_RDMA;
1209+
xprt_load_transport(string);
12081210
break;
12091211
default:
12101212
errors++;
12111213
dfprintk(MOUNT, "NFS: unrecognized "
12121214
"transport protocol\n");
12131215
}
1216+
kfree(string);
12141217
break;
12151218
case Opt_mountproto:
12161219
string = match_strdup(args);
12171220
if (string == NULL)
12181221
goto out_nomem;
12191222
token = match_token(string,
12201223
nfs_xprt_protocol_tokens, args);
1221-
kfree(string);
12221224

12231225
switch (token) {
12241226
case Opt_xprt_udp:

0 commit comments

Comments
 (0)