linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Don't hang user processes if Kerberos ticket for nfs4 mount expires
@ 2011-11-16 18:14 John Hughes
  2011-11-16 19:47 ` Jeff Layton
  0 siblings, 1 reply; 16+ messages in thread
From: John Hughes @ 2011-11-16 18:14 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

With recent kernels if the Kerberos ticket for a nfs4 mount expires any 
user process trying to access the mount hangs until a new ticket is 
obtained.  Simultaneously a (luckily rate-limited, but still seemingly 
endless) stream of "Error: state manager encountered RPCSEC_GSS session 
expired against NFSv4 server" messages is written to the kernel log.

In a common setup with user home directories nfs4 mounted on 
workstations one of the processes that is likely to hang is the 
screen-unlock function which would normally (via pam_krb5 or similar) 
get the new ticket.

In older kernels the EKEYEXPIRED error would be passed to userland, 
which would usualy just give up.

This patch restores the old behavior, which makes nfs4 mounted home 
directories usable for me.




[-- Attachment #2: nfs4-ekeyexpired.patch --]
[-- Type: text/x-patch, Size: 1277 bytes --]

Signed-off-by: John Hughes <john@calva.com>

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4700fae..dc28a78 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -302,7 +302,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;
@@ -3732,7 +3731,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/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 39914be..2bee41e 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1377,8 +1377,9 @@ static int nfs4_recovery_handle_error(struct nfs_client *clp, int error)
 			/* Zero session reset errors */
 			return 0;
 		case -EKEYEXPIRED:
-			/* Nothing we can do */
-			nfs4_warn_keyexpired(clp->cl_hostname);
+			/* Nothing we can do, so do nothing.  Don't even
+			   print a warning message, this is not a kernel
+			   problem */
 			return 0;
 	}
 	return error;

^ permalink raw reply related	[flat|nested] 16+ messages in thread
* Re: [PATCH] Don't hang user processes if Kerberos ticket for nfs4 mount expires
@ 2011-11-18 17:16 Myklebust, Trond
  2011-11-18 17:54 ` Jim Rees
  0 siblings, 1 reply; 16+ messages in thread
From: Myklebust, Trond @ 2011-11-18 17:16 UTC (permalink / raw)
  To: Jim Rees, John Hughes; +Cc: Jeff Layton, linux-nfs, linux-kernel

So what are they supposed to do without tickets? Crash?

Jim Rees <rees@umich.edu> wrote:

I'm not arguing that the client machine should hang when tickets expire.
I'm arguing that user processes should not hang when tickets expire.  Sorry
if that wasn't clear.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-11-18 18:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 18:14 [PATCH] Don't hang user processes if Kerberos ticket for nfs4 mount expires John Hughes
2011-11-16 19:47 ` Jeff Layton
2011-11-16 23:44   ` Jim Rees
2011-11-17  1:31     ` Jeff Layton
2011-11-17  1:38       ` Jeff Layton
2011-11-17 11:05         ` John Hughes
2011-11-17 13:13           ` John Hughes
2011-11-17 21:46             ` Jeff Layton
2011-11-18  1:51               ` Jim Rees
2011-11-18  2:03                 ` Jeff Layton
     [not found]               ` <4EC62325.1060009@Calva.COM>
2011-11-18 12:50                 ` Jim Rees
2011-11-17  1:46       ` Matt W. Benjamin
2011-11-17  9:37   ` John Hughes
  -- strict thread matches above, loose matches on Subject: below --
2011-11-18 17:16 Myklebust, Trond
2011-11-18 17:54 ` Jim Rees
2011-11-18 18:23   ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).