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 <[email protected]>
---
 net/sunrpc/svc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 54f8e8b0bf28..e437e99a0b36 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1258,6 +1258,10 @@ int svc_register(struct svc_serv *serv, struct net *net,
                                break;
                        }
                }
+
+               /* Give up on trying to register anything if it didn't respond 
*/
+               if (noanswer)
+                       break;
        }
 
        if (noanswer)

-- 
2.55.0


Reply via email to