diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 5c6a477c20ec30693267f0425a4117e1f93caef5..83997282fc1aad512315e96eb90eab43ea2e47f4 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -545,6 +545,8 @@ static ssize_t write_ports(struct file *file, char *buf, size_t size) if (nfsd_serv) len = svc_sock_names(buf, nfsd_serv, toclose); unlock_kernel(); + if (len >= 0) + lockd_down(); kfree(toclose); return len; } diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index cba85d195222e9603be9c29c68628b113fd5582a..4e0813b12ccf407bee77511ba0d91de7fffccd76 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -493,6 +493,8 @@ svc_sock_names(char *buf, struct svc_serv *serv, char *toclose) spin_unlock(&serv->sv_lock); if (closesk) svc_delete_socket(closesk); + else if (toclose) + return -ENOENT; return len; } EXPORT_SYMBOL(svc_sock_names);