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@xxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html