All of lore.kernel.org
 help / color / mirror / Atom feed
From: andros@netapp.com
To: trond.myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, Andy Adamson <andros@netapp.com>
Subject: [PATCH 1/1] SUNRPC handle EKEYEXPIRED in call_refreshresult
Date: Wed, 27 Jun 2012 16:05:35 -0400	[thread overview]
Message-ID: <1340827535-3062-2-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1340827535-3062-1-git-send-email-andros@netapp.com>

From: Andy Adamson <andros@netapp.com>

When an RPCSEC_GSS context has expired or is non-existent, and the user
(Kerberos) credentials have also expired or are non-existent, the client
retries to refresh the context for ever and the application
hangs. The user is not prompted to refresh/establish their credentials.

Move the -EKEYEXPIRED handling into the RPC layer. Try tk_cred_retry number
of times to refresh the gss_context, and then pass -EPERM to application.

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/nfs4proc.c |    2 --
 net/sunrpc/clnt.c |    4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5a7b372..2f291b3 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -342,7 +342,6 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
 			}
 		case -NFS4ERR_GRACE:
 		case -NFS4ERR_DELAY:
-		case -EKEYEXPIRED:
 			ret = nfs4_delay(server->client, &exception->timeout);
 			if (ret != 0)
 				break;
@@ -3939,7 +3938,6 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
 		case -NFS4ERR_DELAY:
 			nfs_inc_server_stats(server, NFSIOS_DELAY);
 		case -NFS4ERR_GRACE:
-		case -EKEYEXPIRED:
 			rpc_delay(task, NFS4_POLL_RETRY_MAX);
 			task->tk_status = 0;
 			return -EAGAIN;
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index f56f045..a94fc0c 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1334,8 +1334,12 @@ call_refreshresult(struct rpc_task *task)
 		return;
 	case -ETIMEDOUT:
 		rpc_delay(task, 3*HZ);
+	case -EKEYEXPIRED:
+		status = -EPERM;
+		goto cred_retry;
 	case -EAGAIN:
 		status = -EACCES;
+cred_retry:
 		if (!task->tk_cred_retry)
 			break;
 		task->tk_cred_retry--;
-- 
1.7.7.6


  reply	other threads:[~2012-06-27 20:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27 20:05 [PATCH 0/1] SUNRPC handle EKEYEXPIRED in call_refreshresult andros
2012-06-27 20:05 ` andros [this message]
2012-07-16 18:44   ` [PATCH 1/1] " Myklebust, Trond
2012-07-16 20:09     ` Adamson, Andy
2012-06-28 15:43 ` [PATCH 0/1] " Jeff Layton
2012-06-28 16:31   ` Adamson, Andy
2012-06-28 18:03     ` Jeff Layton
2012-06-28 23:33       ` Andy Adamson
2012-06-29 20:43         ` Steve Dickson
2012-06-30 11:00           ` Jeff Layton

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=1340827535-3062-2-git-send-email-andros@netapp.com \
    --to=andros@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@netapp.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.