linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Trond Myklebust <trondmy@gmail.com>,
	Anna Schumaker <Anna.Schumaker@netapp.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH] Stop mounts hanging in upcalls to rpc.gssd.
Date: Mon, 18 Jun 2018 13:25:42 -0400	[thread overview]
Message-ID: <20180618172542.45519-1-steved@redhat.com> (raw)

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


             reply	other threads:[~2018-06-18 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 17:25 Steve Dickson [this message]
     [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                     ` [PATCH] Stop mounts hanging in upcalls to rpc.gssd 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

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=20180618172542.45519-1-steved@redhat.com \
    --to=steved@redhat.com \
    --cc=Anna.Schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@gmail.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 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).