diff options
author | J. Bruce Fields <bfields@redhat.com> | 2016-05-18 14:50:14 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-05-23 10:55:24 -0400 |
commit | d96b9c9398fcddca7f2386cff44a6788edfe7db1 (patch) | |
tree | 771ebe4a33c8383821cbade211f8f514d2677caf /net/sunrpc/svc_xprt.c | |
parent | d9e4084f6c9746e51a78a4d7ebf4983023289b32 (diff) |
svcrpc: autoload rdma module
This should fix failures like:
# rpc.nfsd --rdma
rpc.nfsd: Unable to request RDMA services: Protocol not supported
Reported-by: Steve Dickson <steved@redhat.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 7422f28818b2..f5572e31d518 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -244,13 +244,12 @@ void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new) | |||
244 | svc_xprt_received(new); | 244 | svc_xprt_received(new); |
245 | } | 245 | } |
246 | 246 | ||
247 | int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | 247 | int _svc_create_xprt(struct svc_serv *serv, const char *xprt_name, |
248 | struct net *net, const int family, | 248 | struct net *net, const int family, |
249 | const unsigned short port, int flags) | 249 | const unsigned short port, int flags) |
250 | { | 250 | { |
251 | struct svc_xprt_class *xcl; | 251 | struct svc_xprt_class *xcl; |
252 | 252 | ||
253 | dprintk("svc: creating transport %s[%d]\n", xprt_name, port); | ||
254 | spin_lock(&svc_xprt_class_lock); | 253 | spin_lock(&svc_xprt_class_lock); |
255 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { | 254 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { |
256 | struct svc_xprt *newxprt; | 255 | struct svc_xprt *newxprt; |
@@ -274,12 +273,28 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | |||
274 | } | 273 | } |
275 | err: | 274 | err: |
276 | spin_unlock(&svc_xprt_class_lock); | 275 | spin_unlock(&svc_xprt_class_lock); |
277 | dprintk("svc: transport %s not found\n", xprt_name); | ||
278 | |||
279 | /* This errno is exposed to user space. Provide a reasonable | 276 | /* This errno is exposed to user space. Provide a reasonable |
280 | * perror msg for a bad transport. */ | 277 | * perror msg for a bad transport. */ |
281 | return -EPROTONOSUPPORT; | 278 | return -EPROTONOSUPPORT; |
282 | } | 279 | } |
280 | |||
281 | int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | ||
282 | struct net *net, const int family, | ||
283 | const unsigned short port, int flags) | ||
284 | { | ||
285 | int err; | ||
286 | |||
287 | dprintk("svc: creating transport %s[%d]\n", xprt_name, port); | ||
288 | err = _svc_create_xprt(serv, xprt_name, net, family, port, flags); | ||
289 | if (err == -EPROTONOSUPPORT) { | ||
290 | request_module("svc%s", xprt_name); | ||
291 | err = _svc_create_xprt(serv, xprt_name, net, family, port, flags); | ||
292 | } | ||
293 | if (err) | ||
294 | dprintk("svc: transport %s not found, err %d\n", | ||
295 | xprt_name, err); | ||
296 | return err; | ||
297 | } | ||
283 | EXPORT_SYMBOL_GPL(svc_create_xprt); | 298 | EXPORT_SYMBOL_GPL(svc_create_xprt); |
284 | 299 | ||
285 | /* | 300 | /* |