diff options
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfsctl.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index f43ecd61fa81..0f0e77f2012f 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -988,6 +988,7 @@ static ssize_t __write_ports_delfd(char *buf) | |||
988 | static ssize_t __write_ports_addxprt(char *buf) | 988 | static ssize_t __write_ports_addxprt(char *buf) |
989 | { | 989 | { |
990 | char transport[16]; | 990 | char transport[16]; |
991 | struct svc_xprt *xprt; | ||
991 | int port, err; | 992 | int port, err; |
992 | 993 | ||
993 | if (sscanf(buf, "%15s %4u", transport, &port) != 2) | 994 | if (sscanf(buf, "%15s %4u", transport, &port) != 2) |
@@ -1003,8 +1004,23 @@ static ssize_t __write_ports_addxprt(char *buf) | |||
1003 | err = svc_create_xprt(nfsd_serv, transport, | 1004 | err = svc_create_xprt(nfsd_serv, transport, |
1004 | PF_INET, port, SVC_SOCK_ANONYMOUS); | 1005 | PF_INET, port, SVC_SOCK_ANONYMOUS); |
1005 | if (err < 0) | 1006 | if (err < 0) |
1006 | return err; | 1007 | goto out_err; |
1008 | |||
1009 | err = svc_create_xprt(nfsd_serv, transport, | ||
1010 | PF_INET6, port, SVC_SOCK_ANONYMOUS); | ||
1011 | if (err < 0 && err != -EAFNOSUPPORT) | ||
1012 | goto out_close; | ||
1007 | return 0; | 1013 | return 0; |
1014 | out_close: | ||
1015 | xprt = svc_find_xprt(nfsd_serv, transport, PF_INET, port); | ||
1016 | if (xprt != NULL) { | ||
1017 | svc_close_xprt(xprt); | ||
1018 | svc_xprt_put(xprt); | ||
1019 | } | ||
1020 | out_err: | ||
1021 | /* Decrease the count, but don't shut down the service */ | ||
1022 | nfsd_serv->sv_nrthreads--; | ||
1023 | return err; | ||
1008 | } | 1024 | } |
1009 | 1025 | ||
1010 | /* | 1026 | /* |