diff options
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfssvc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index f1314c63e823..cdec3993e0d5 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -221,18 +221,22 @@ static int nfsd_init_socks(int port) if (!list_empty(&nfsd_serv->sv_permsocks)) return 0; - error = svc_makesock(nfsd_serv, IPPROTO_UDP, port); - if (error < 0) - return error; error = lockd_up(IPPROTO_UDP); + if (error >= 0) { + error = svc_makesock(nfsd_serv, IPPROTO_UDP, port); + if (error < 0) + lockd_down(); + } if (error < 0) return error; #ifdef CONFIG_NFSD_TCP - error = svc_makesock(nfsd_serv, IPPROTO_TCP, port); - if (error < 0) - return error; error = lockd_up(IPPROTO_TCP); + if (error >= 0) { + error = svc_makesock(nfsd_serv, IPPROTO_TCP, port); + if (error < 0) + lockd_down(); + } if (error < 0) return error; #endif |