Received: by 10.192.165.156 with SMTP id m28csp1146107imm; Wed, 11 Apr 2018 13:17:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/tLps7S+2DaAM1unajWmX7sl9MhP3LDXxbw6yuUy+NPMdT0L8fpm3epRXeNXju3Ft5IIhp X-Received: by 2002:a17:902:149:: with SMTP id 67-v6mr6695351plb.296.1523477874231; Wed, 11 Apr 2018 13:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523477874; cv=none; d=google.com; s=arc-20160816; b=aqIb9+BT8gEk2yUUl0/9BYbZgoyf600gIV9IlJ4ws29l4Q1etfaHVFxduhiHCP0KRy U8lI0+UK6rCwLI9tCGUcDShQeQ9xYyynrCzMsKKYNbE65sDbvZxYv1ZqF899mz9baTtX MjOlLriIXsRJb8v1/bkI1iiFQz/35aIulycZZCt5WtBRQ2CuBW3sFjn1i7CfO1MsTNxH Ktynxbm6hCQ2lpsz7XFORXpvBC9cPHIxFDexbAViXfkWNjcO5kjsu8sIfal2pKx1i615 p4Wk2xS9/1cVA+2l/QDfE4xXIjECa9Q4BfXzwTgznPBViqHmQHApXnUqcFWXQ9wHG4Kf oBlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=0zcW6lUfIZjKH8pZjJo56s1WL3hbrpZrPhhkgh9Nv8Q=; b=ehb7y0mGAtA3J41joiJQ6DEeWRXnpNvocQbCTAk+3hwTkHwTeGQYXjIxreWa0iqpPR mrimHYuo1/bTLWVtDM7SZ8OwMkIJdzvSmLqGLb73BD8xuSg+VMhkAwJjQrkulc/BeydD TyFLN0+XcKu+ZGrEvMI4RJiiK0wj8siyJWSECX1pXN+g9iT6cyrHG70ZCJzbs+Fm2mE6 eyC3iQmv1UG6tdJZXmjg1ovAaVAg9WfFJyOAzV+WKoW5XI/Bz98qFDjygmolbGqt07JX ibBuX8ZY5UBDh3FS0HmpvPAv4aoMkkPVPKGGT7ej2Uus+Zi0bCm2rXm6eX2rIbtkLlvK 22tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 r20si1406205pfk.224.2018.04.11.13.17.17; Wed, 11 Apr 2018 13:17:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757231AbeDKUMg (ORCPT + 99 others); Wed, 11 Apr 2018 16:12:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34034 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933372AbeDKSx5 (ORCPT ); Wed, 11 Apr 2018 14:53:57 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C31B2EBA; Wed, 11 Apr 2018 18:53:56 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuck Lever , Trond Myklebust , Sasha Levin Subject: [PATCH 4.9 008/310] NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION Date: Wed, 11 Apr 2018 20:32:27 +0200 Message-Id: <20180411183622.649253940@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust [ Upstream commit 0048fdd06614a4ea088f9fcad11511956b795698 ] If the server returns NFS4ERR_CONN_NOT_BOUND_TO_SESSION because we are trunking, then RECLAIM_COMPLETE must handle that by calling nfs4_schedule_session_recovery() and then retrying. Reported-by: Chuck Lever Signed-off-by: Trond Myklebust Tested-by: Chuck Lever Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4proc.c | 7 ++++++- fs/nfs/nfs4state.c | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -8173,6 +8173,12 @@ static int nfs41_reclaim_complete_handle /* fall through */ case -NFS4ERR_RETRY_UNCACHED_REP: return -EAGAIN; + case -NFS4ERR_BADSESSION: + case -NFS4ERR_DEADSESSION: + case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION: + nfs4_schedule_session_recovery(clp->cl_session, + task->tk_status); + break; default: nfs4_schedule_lease_recovery(clp); } @@ -8251,7 +8257,6 @@ static int nfs41_proc_reclaim_complete(s if (status == 0) status = task->tk_status; rpc_put_task(task); - return 0; out: dprintk("<-- %s status=%d\n", __func__, status); return status; --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1637,13 +1637,14 @@ static void nfs4_state_start_reclaim_reb nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot); } -static void nfs4_reclaim_complete(struct nfs_client *clp, +static int nfs4_reclaim_complete(struct nfs_client *clp, const struct nfs4_state_recovery_ops *ops, struct rpc_cred *cred) { /* Notify the server we're done reclaiming our state */ if (ops->reclaim_complete) - (void)ops->reclaim_complete(clp, cred); + return ops->reclaim_complete(clp, cred); + return 0; } static void nfs4_clear_reclaim_server(struct nfs_server *server) @@ -1690,13 +1691,16 @@ static void nfs4_state_end_reclaim_reboo { const struct nfs4_state_recovery_ops *ops; struct rpc_cred *cred; + int err; if (!nfs4_state_clear_reclaim_reboot(clp)) return; ops = clp->cl_mvops->reboot_recovery_ops; cred = nfs4_get_clid_cred(clp); - nfs4_reclaim_complete(clp, ops, cred); + err = nfs4_reclaim_complete(clp, ops, cred); put_rpccred(cred); + if (err == -NFS4ERR_CONN_NOT_BOUND_TO_SESSION) + set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state); } static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp)