Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3446528yba; Mon, 29 Apr 2019 02:28:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzb7FgBsgMOYwihRGEAD/BiVOmJKLRKiNJDz5v/liVESQO5m/0GvkhdP2L4Bv/4EE05r3zF X-Received: by 2002:a17:902:9a83:: with SMTP id w3mr61589818plp.241.1556530125734; Mon, 29 Apr 2019 02:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556530125; cv=none; d=google.com; s=arc-20160816; b=w+7jx9MY965bcUgEcAWqxvJhAyfR59nicWePETOukUYMnYp2AS+xE2wv0jPgrvQR/6 ugZYQe6XJt1YJBM1SuNOKJU0LcqCJ1tfOLQ95cGcGhpjGoex538/ZxOzD/fTFC/GCtmb eDePvHk9V72THqEnuwx+c79mIImdGXMdFlGZYeAL48sBNXIS1jSLVwTHXJI6T2NZnmlX yow1L72qHZKF9k9LLVgKHjCSjcnSCjWsg+LOip8BEk89feoqj/R0lWyNpk6n37Co2daS MQk7QQCjY67ARpmSPSiGnffytkhxBD+Le9JhO6R4uYhX9ogZquld3PqTIZqJR9lbSl5z 1cbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from; bh=thCTh+j8BZOFdrHjqCFC+KdDDvZ8XD2V6ETwhqsx2ng=; b=D6bh+YlGsju4StUs47sU3xLQe2wqxT3poC1v0zl2wQXs0bVP6Btv3EHJFJSz9W7Kxz 3HScYXzPgeBEEBV6eyD3pJvu7MsdU1SXqiJqqgZoYPEQ+EefZ1IhMVQB+FpOeYhpoif+ wq/u//jVc9n6100mIG+4PbYWLHLhUaR3Wrc2aYsXOv8BQOwizf2ZgtfnlIdhHInyef5a hH7GfKao0SsX1JHUgd8ZpE5Puq9rbsyVo8o1OT5YHfFAEmu8wAqXxHJseQ5cJ5MDYwrZ 9MIqZviZVthw5Kqk+Rb5OVKII1obt114p4+as2ZOdBSwmZzF/7YpkPJFTMKcP0rKX3WV LLDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si32507156plq.56.2019.04.29.02.28.20; Mon, 29 Apr 2019 02:28:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727405AbfD2J2P (ORCPT + 99 others); Mon, 29 Apr 2019 05:28:15 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7706 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727325AbfD2J2P (ORCPT ); Mon, 29 Apr 2019 05:28:15 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D98831F91F8ED0BC2DE7; Mon, 29 Apr 2019 17:28:12 +0800 (CST) Received: from RH5885H-V3.huawei.com (10.90.53.225) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Mon, 29 Apr 2019 17:28:06 +0800 From: ZhangXiaoxu To: , , , , , , Subject: [PATCH] SUNRPC: task should be exit if encode return EKEYEXPIRED more times Date: Mon, 29 Apr 2019 17:32:31 +0800 Message-ID: <1556530351-81780-1-git-send-email-zhangxiaoxu5@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If the rpc.gssd always return cred success, but now the cred is expired, then the task will loop in call_refresh and call_transmit. Exit the rpc task after retry. Signed-off-by: ZhangXiaoxu --- net/sunrpc/clnt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 8ff11dc..a32d3f1 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1793,7 +1793,14 @@ call_encode(struct rpc_task *task) rpc_delay(task, HZ >> 4); break; case -EKEYEXPIRED: - task->tk_action = call_refresh; + if (!task->tk_cred_retry) { + rpc_exit(task, task->tk_status); + } else { + task->tk_action = call_refresh; + task->tk_cred_retry--; + dprintk("RPC: %5u %s: retry refresh creds\n", + task->tk_pid, __func__); + } break; default: rpc_exit(task, task->tk_status); -- 2.7.4