linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Stop mounts hanging in upcalls to rpc.gssd.
@ 2018-06-18 17:25 Steve Dickson
       [not found] ` <0e1aa697-e0ee-d150-3720-3cdda2d2f700@RedHat.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Dickson @ 2018-06-18 17:25 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker; +Cc: Linux NFS Mailing list

To stop mounts hanging forever due to a hung
upcall to rpc.gssd, this patch adds a 5 sec
timeout to that upcall.

When the upcall does hung the mount will timeout
in about a min or so due to all the retries by the
sunrpc layer.

The mount will either fail when a krb5 flavor is
specified or roll back to a sys flavor mount.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 net/sunrpc/auth_gss/auth_gss.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index be8f103d22fd..407a9a571be0 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -75,6 +75,8 @@ static unsigned int gss_key_expire_timeo = GSS_KEY_EXPIRE_TIMEO;
  * using integrity (two 4-byte integers): */
 #define GSS_VERF_SLACK		100
 
+#define GSS_UPCALL_TIMEO (5 * HZ)
+
 static DEFINE_HASHTABLE(gss_auth_hash_table, 4);
 static DEFINE_SPINLOCK(gss_auth_hash_lock);
 
@@ -658,7 +660,14 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
 			err = -ERESTARTSYS;
 			goto out_intr;
 		}
-		schedule();
+		if (schedule_timeout(GSS_UPCALL_TIMEO) == 0) {
+			warn_gssd();
+			if (!gssd_running(net))
+				err = -EACCES;
+			else
+				err = -ETIMEDOUT;
+			goto out_intr;
+		}
 	}
 	if (gss_msg->ctx)
 		gss_cred_set_ctx(cred, gss_msg->ctx);
-- 
2.17.1


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

end of thread, other threads:[~2018-06-25 16:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 17:25 [PATCH] Stop mounts hanging in upcalls to rpc.gssd Steve Dickson
     [not found] ` <0e1aa697-e0ee-d150-3720-3cdda2d2f700@RedHat.com>
     [not found]   ` <80bc2e24a8f4168ba144ee4757817dc749a441d8.camel@gmail.com>
     [not found]     ` <17b2fd3e-c9f4-6804-363a-1d49ca990940@RedHat.com>
     [not found]       ` <B3A9BE44-BA84-49E6-A72E-A3EBABCFE093@gmail.com>
     [not found]         ` <2f89b1e5-7e3d-c584-9f09-78b6f3e8a6f4@RedHat.com>
     [not found]           ` <CAABAsM7m6FgOSdC2Nzm-+gsZQcCGBt2HBgw3Yp6vuFbrFV_6gw@mail.gmail.com>
     [not found]             ` <26557818-3e4f-684b-c4a2-5fc63959930c@RedHat.com>
     [not found]               ` <CAABAsM5Y=N7tG8CnVn8f=U6a4MU4EXYCC8e2MkyM6=-mxXg0Wg@mail.gmail.com>
     [not found]                 ` <919983d5-5e20-887d-eac7-822fd801106a@RedHat.com>
     [not found]                   ` <8EFFA012-4DF5-4B94-AB9F-DCCEDD646D02@gmail.com>
2018-06-25 13:54                     ` Steve Dickson
2018-06-25 15:10                       ` Chuck Lever
2018-06-25 15:38                         ` Trond Myklebust
2018-06-25 15:51                           ` Steve Dickson
2018-06-25 16:19                             ` 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).