Received: by 10.213.65.68 with SMTP id h4csp1690775imn; Mon, 19 Mar 2018 10:39:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELtecP1ZOZrdvPv+eO11yMV4wm3O3vqE7Y0zy8WijtTAIos5bt6hsJxbRKemORg9TZF9L0ty X-Received: by 10.99.49.143 with SMTP id x137mr9934924pgx.424.1521481173825; Mon, 19 Mar 2018 10:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521481173; cv=none; d=google.com; s=arc-20160816; b=NzAxj5438TKLEL2Q5jxhhWPbNqQj09V78vPZPtoVIIgxzLOuI29+WY1MM1alpJGatD OCwCyKLEiQkgJxA/br92H3fGxnvpg+a828FxrrIrFf4aTBsqb6rlBPv5dVokfNJSmqvs GrEqHw7ptGdiYZrVf93DIP+RG/FVGW6DLaQIMkGOxRV0Esa9X7RoWg5kIQJkdODNgwUC zejJyAwp2+6oWqy8htu0yaGNb/BVurYDCQb4GUYGkW8gnwvhS4tcLF8Do8YpdNP6e3Ds 4S05QGhfkSlPCa/Cyst8idMQ/5cVJQdhdL+mgRQvhra7WNzAqS5+VncCiy+PkRJlAbcO 9yaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=hcVc0fMrmvZXs0zhGJp9qNjT/FLPlzUzrkZYx2OlQS4=; b=hMVeTqWiyOLMnnUXtr/anINK4yEPgv7ZYKHMyD6fW2eQkk1+574hF3oryDuYz81VHn 2/Q6fW82ExH4WeQhdHU0M+lP0xSoaHMK2/vHmaYFXoL3ouZqL1sAcZ/8myGpBEJqDwy3 m2pxvkHH+NeYei/e+398tgb74lXgchMIvqB8XH0Q3vcIwkCznLO8VdcNcK94ThRN9mj4 t066WgllF4hlpfzVMjhAZExEPzVdfrm8sI6FS3l73vSXVETErAiDw9YNfVdkdS6ekrat sE+4lhvehtS+6o9Sy0nRgVE7bO0GSxZvaxc0Pc8/z3fW/+yA7f55eO1cILj88pSZewzK Yi2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PvbPYiW5; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si190636pgt.680.2018.03.19.10.39.19; Mon, 19 Mar 2018 10:39:33 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PvbPYiW5; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967549AbeCSRhU (ORCPT + 99 others); Mon, 19 Mar 2018 13:37:20 -0400 Received: from mail-by2nam03on0122.outbound.protection.outlook.com ([104.47.42.122]:28800 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965981AbeCSQGo (ORCPT ); Mon, 19 Mar 2018 12:06:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hcVc0fMrmvZXs0zhGJp9qNjT/FLPlzUzrkZYx2OlQS4=; b=PvbPYiW5SbvZP5hhFH5LT10G0hIP2rHxBtuyKhU3uet9c2S8W501ntRVuAIAGv+VPNPWb69YA5oHE9ImezB6Er1fudXhVBd+LpHgRGXYkKjVsuMy2qS9l7ZprO4dOmJ7pYlV5ArJz6DTSfFdxdEPzEbEdtJHazXraSYMxljCgE8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0920.namprd21.prod.outlook.com (52.132.132.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:06:41 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:06:41 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Trond Myklebust , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 005/167] NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION Thread-Topic: [PATCH AUTOSEL for 4.4 005/167] NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION Thread-Index: AQHTv5wX5g2HFNt8kki2PiSNsUUT9g== Date: Mon, 19 Mar 2018 16:05:25 +0000 Message-ID: <20180319160513.16384-5-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0920;7:OYhV3ceEgSYs0QJ5QHU9NO+EYhlx2zv61AtONcLPquoY+xjcWs9luC5VhfDNedDfu/yVixUV9h635boPTTJIawbgTGAZ3CC4oTXScVMI4kqogD7QSB6cQqxZV47yCAmr2vgWM6UD98yJdWYqBy3fr8idnfMNpd5Se6gYkxndQOfam7XHNv3Z88MPRYyePGh7EQosIMZk8WHpZ12kTy33EQN3cj5mSklxDa96+bJTKPUQJ0no9+9rXvBEGVfSWLzt;20:aCsO+C3sIvA/DkH0HLOyCkQLeu1J1u7fefPOPpBKWaPJgeAMOMzaEeCtI/7zbYj3V6AlB2mYTrgUxGjV0lbZaFeqHG9OR2vPfEPJ/+O2z7O9u+f8F6g+uk9cd1SHlptXoV1AGFuA4IStIRS+tuwAQhCep93yZZ/n3fg+MtrNoJ0= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 045b5f5b-b634-4911-e5df-08d58db3676e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0920; x-ms-traffictypediagnostic: DM5PR2101MB0920: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(158342451672863)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0920;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0920; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(396003)(376002)(39860400002)(366004)(189003)(199004)(6512007)(14454004)(2906002)(2900100001)(8936002)(186003)(86362001)(5250100002)(316002)(97736004)(2501003)(6116002)(1076002)(3846002)(81166006)(6436002)(6506007)(6486002)(26005)(72206003)(81156014)(53936002)(102836004)(478600001)(10290500003)(8676002)(575784001)(107886003)(6666003)(4326008)(3660700001)(66066001)(25786009)(2950100002)(86612001)(36756003)(54906003)(110136005)(3280700002)(7736002)(305945005)(5660300001)(76176011)(68736007)(22452003)(10090500001)(105586002)(106356001)(15760500003)(99286004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0920;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 2QYVhF8D2J7foJrRB7/441F+m7a/HR9DdUjqEWjqDnBi1GxPt77fglqrn3iIlF7R6uXubaXPOFjsKrwsVIpxyBhCSUg3jwFt4QVuixCnzCYt2zid6V+0ORdY0PQQ0Bz25tSDzHXru4lQdn9MrDBEDjF909OLl61wzxb+PfReoE8qlSt+CSsG/xUBfA0qGS3v4NyO2PckuwvaK5ye+6OQaf6NUFlttPiTWpmZHFt0VxLb/fQK22FkxYnvU8cwwp5y6fKdde9BWMtCDnnuHKmEVyQWHw5ZON9mG/tRwVxrew8b36PE7ygUMs9IrgXkpbb6VdxDVIWz2UwaKbaYOsgVpA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 045b5f5b-b634-4911-e5df-08d58db3676e X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:05:25.9660 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0920 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/nfs/nfs4proc.c | 7 ++++++- fs/nfs/nfs4state.c | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 8ef6f70c9e25..bcfddfc7a1f4 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7670,6 +7670,12 @@ static int nfs41_reclaim_complete_handle_errors(stru= ct rpc_task *task, struct nf /* 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); } @@ -7748,7 +7754,6 @@ static int nfs41_proc_reclaim_complete(struct nfs_cli= ent *clp, if (status =3D=3D 0) status =3D task->tk_status; rpc_put_task(task); - return 0; out: dprintk("<-- %s status=3D%d\n", __func__, status); return status; diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 9a0b219ff74d..83fba40396ae 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1593,13 +1593,14 @@ static void nfs4_state_start_reclaim_reboot(struct = nfs_client *clp) nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot); } =20 -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; } =20 static void nfs4_clear_reclaim_server(struct nfs_server *server) @@ -1646,13 +1647,16 @@ static void nfs4_state_end_reclaim_reboot(struct nf= s_client *clp) { const struct nfs4_state_recovery_ops *ops; struct rpc_cred *cred; + int err; =20 if (!nfs4_state_clear_reclaim_reboot(clp)) return; ops =3D clp->cl_mvops->reboot_recovery_ops; cred =3D nfs4_get_clid_cred(clp); - nfs4_reclaim_complete(clp, ops, cred); + err =3D nfs4_reclaim_complete(clp, ops, cred); put_rpccred(cred); + if (err =3D=3D -NFS4ERR_CONN_NOT_BOUND_TO_SESSION) + set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state); } =20 static void nfs_delegation_clear_all(struct nfs_client *clp) --=20 2.14.1