SUNRPC: stop svc_register() once rpcbind stops answering

svc_register() walks every program and every version. The break on error
leaves the version loop only, so a program whose call to the local rpcbind
timed out is followed by the next program timing out in the same way. With
the 1s bound on the local rpcbind client, an nfsd serv pays 2s for that,
once for nfsd and once for nfsacl.

Stop the program loop too, but only when the call got no answer.

Assisted-by: LLM
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260901-nfsd-nl-hang-v5-7-a540d86668b0@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
This commit is contained in:
Jeff Layton 2026-09-01 09:39:45 -04:00 committed by Chuck Lever
parent 202a557d0c
commit ba8c47f049

View File

@ -1257,7 +1257,13 @@ int svc_register(struct svc_serv *serv, struct net *net,
error = ret;
break;
}
if (noanswer)
break;
}
/* Give up on trying to register anything if it didn't respond */
if (noanswer)
break;
}
if (noanswer)