From: Trond Myklebust <Trond.Myklebust@netapp.com> To: bjschuma@netapp.com Cc: linux-nfs@vger.kernel.org Subject: SUNRPC: Fix an infinite loop in call_refresh/call_refreshresult Date: Fri, 19 Nov 2010 16:19:57 -0500 [thread overview] Message-ID: <1290201597.3135.57.camel@heimdal.trondhjem.org> (raw) From: Trond Myklebust <Trond.Myklebust@netapp.com> If the rpcauth_refreshcred() call returns an error other than EACCES, ENOMEM or ETIMEDOUT, we currently end up looping forever between call_refresh and call_refreshresult. The correct thing to do here is to exit on all errors except EAGAIN and ETIMEDOUT. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> --- net/sunrpc/clnt.c | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 9dab957..7b7dc4e 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -989,20 +989,18 @@ call_refreshresult(struct rpc_task *task) dprint_status(task); task->tk_status = 0; - task->tk_action = call_allocate; - if (status >= 0 && rpcauth_uptodatecred(task)) - return; + task->tk_action = call_refresh; switch (status) { - case -EACCES: - rpc_exit(task, -EACCES); - return; - case -ENOMEM: - rpc_exit(task, -ENOMEM); + case 0: + if (rpcauth_uptodatecred(task)) + task->tk_action = call_allocate; return; case -ETIMEDOUT: rpc_delay(task, 3*HZ); + case -EAGAIN: + return; } - task->tk_action = call_refresh; + rpc_exit(task, status); } /* -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@netapp.com www.netapp.com
next reply other threads:[~2010-11-19 21:20 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-11-19 21:19 Trond Myklebust [this message] 2010-11-22 18:30 ` [PATCH v2] " Trond Myklebust
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1290201597.3135.57.camel@heimdal.trondhjem.org \ --to=trond.myklebust@netapp.com \ --cc=bjschuma@netapp.com \ --cc=linux-nfs@vger.kernel.org \ --subject='Re: SUNRPC: Fix an infinite loop in call_refresh/call_refreshresult' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.