Received: by 10.213.65.68 with SMTP id h4csp34762imn; Mon, 19 Mar 2018 18:40:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELshIPY7SXeyuhyVK2bVTVWDqTlZRFwOM+FWk/cWu6kpFiHRRUgBSbQlAjOoEVmkYKEtQwQ3 X-Received: by 2002:a17:902:9045:: with SMTP id w5-v6mr14951134plz.104.1521510006088; Mon, 19 Mar 2018 18:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510006; cv=none; d=google.com; s=arc-20160816; b=T3Tt0ZUKm1oEWiYLpviWBcPTGbJZMOnTL2W8LpmySfmyn7jXWyRzD3Wbsr8yVHJ7Mv HdiHBexG3x3+J0IeQTZF1Z9sCdWph75ffhqBC+bzySCp65fwM6aWKwnhG7CaFIf9bNoj H0ntNK+PWGwBvA6a5u3k6kUg7cZDRXeJT8Q1jIrGjTxEPslZScDd/xBmKtkUqx7VfK3/ vbER7VV9/sbtIhaixnRMJx0SvG4Pf/z+NAfy9rwdzf88c5Ru0wocVHLIBCB7+2faV5QJ xIYze/cYlK67splkeJb/BbfaNKRnzgbIIwJ+IiEqYP5A7uPbNazUkzRyqDZSLSddlxwB LM8A== 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=Vi2ffZzl+sN8YDDRYuhBx8scQHZ5xk64YRAu22YR1a8=; b=yUXYt9cphtrjWjRqiA1eRrk/yAs4ttbvlQveNnYU92OGKdIfYnyDKBw6HEeFUeqy6J Id6Ks7cAeCL5ObNSa676W+OkoL39jgXa0hrwgh1XzSfehBk77pSP7wa/6QuJaKV9RTpi 6skzf///BzXrCvwZS76FW1LL8rQqMGx9XzH4VFis2Q0C2B9PHZCCWRcUl3jBqqrWxnFS IiQy/x293liRilH1vR3b422ZasnLCZ6yGmDY/UOLVgny7dZojztr632gQMlaAD4sZBUa Q/TCdvCC1ZH6oeljKjwwTQISnf4yRtT7CLGp09w4ndbm6H0uAHMsYC43LcnOSSJub6XS 8JIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=D+D6P0ks; 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 a74si430938pfj.287.2018.03.19.18.39.52; Mon, 19 Mar 2018 18:40:06 -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=D+D6P0ks; 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 S967939AbeCSRP3 (ORCPT + 99 others); Mon, 19 Mar 2018 13:15:29 -0400 Received: from mail-by2nam01on0111.outbound.protection.outlook.com ([104.47.34.111]:9825 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966548AbeCSQKC (ORCPT ); Mon, 19 Mar 2018 12:10:02 -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=Vi2ffZzl+sN8YDDRYuhBx8scQHZ5xk64YRAu22YR1a8=; b=D+D6P0ks3OCciV612sB4Pk60qBzs4/xYMxI5czdpBY4mQTobi0MlkvgwzAmNPnNDSpFOac/BnAykhh2kaN7SEbtnY80ExSCs5PbdypNPSNP+x8CKMw5NwFoUi4wzVKVeA4j7JsxgZQbFSfedpcMGe7bkL7MAZSQ6LbQ6VjUrY6w= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0919.namprd21.prod.outlook.com (52.132.132.164) 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:09:56 +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:09:56 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: NeilBrown , Trond Myklebust , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 107/167] SUNRPC: ensure correct error is reported by xs_tcp_setup_socket() Thread-Topic: [PATCH AUTOSEL for 4.4 107/167] SUNRPC: ensure correct error is reported by xs_tcp_setup_socket() Thread-Index: AQHTv5xlC0/jzdm3bUa8OdLoF4Yf9g== Date: Mon, 19 Mar 2018 16:07:36 +0000 Message-ID: <20180319160513.16384-107-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;DM5PR2101MB0919;7:IzH4vINZqakoR/AAr2dO+bANqzpoewM9YXX5vA3j6y6KuJ2GKiHFKc4FQwzBxJfACuv3gf4eSkts+FsE3lI+NnqITqbWCfyFF4t1yzBfRWxfOBvhc7RDT1l4rI1aJnbwaVCaLd6mdeLaa2SuT0yp2Oaf9LrqcijJHRePUS3U1C8kGnPIQF58ITMgut9V9qgjpP5Ga/JxzRCTaouYMyKWnV5M5mgLHIfkS11ZvOFQEwYnQ1ebk2bb466QmuFVlE5l;20:wp0noioLl5sAa8cCn4bEcDtpleamgCebg2vpmrgP7opMwwA7CJSZunvwUTt8/Ks62mND7sun/UQ9KXPzBexwZ268tPofVPbfkrJnE8sKAu5lC6LydExc5RcF7E6M/9hOUguUJc2VU2Bvub1npGgY16S8+pMXfy9xKvOdBEHDuTc= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 661d3471-8fdd-4480-e261-08d58db3dbbb x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0919; x-ms-traffictypediagnostic: DM5PR2101MB0919: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); 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:DM5PR2101MB0919;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0919; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(396003)(39860400002)(376002)(366004)(199004)(189003)(66066001)(575784001)(2906002)(86362001)(10290500003)(105586002)(8676002)(305945005)(110136005)(478600001)(4326008)(7736002)(81166006)(3280700002)(6506007)(97736004)(107886003)(5660300001)(36756003)(8936002)(53936002)(86612001)(14454004)(59450400001)(1076002)(2501003)(6116002)(10090500001)(76176011)(186003)(3846002)(5250100002)(6512007)(99286004)(102836004)(106356001)(72206003)(81156014)(2950100002)(6666003)(54906003)(3660700001)(22452003)(68736007)(6486002)(25786009)(26005)(316002)(2900100001)(6436002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0919;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Xeq5Gmozpyf0sQuhOVXdNT8uBIcMRQT2VJ7Q/tc+SXfxLAyAC/RjR3PIIxZYcqAcSpKb4wr8SyD27o2uqBeHREcR3jmG7mDIajskpp1wLNdG2gZe7eLFC9r6D6bJYz3wu1UnskV1jsdyrvcM0VantNsLUiNJuZ9YSPCL3okI/unm1/Va/BhK8aK9E7uiADVe6xjyQ0e5EoAbhcnnX1KA80HpL0MFNNmQgB/AiBdKHJoJz/drzSsXpS9SoNjLcGhnFoiaScix4t2aNZR6EHtLtEPRGfWZjVXmj/bXH19kQhH01GICZIQAvQhwZKc5SCmdaHODEgNRR6cFlh0gPKdJ3A== 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: 661d3471-8fdd-4480-e261-08d58db3dbbb X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:07:36.1822 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0919 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: NeilBrown [ Upstream commit 6ea44adce91526700535b3150f77f8639ae8c82d ] If you attempt a TCP mount from an host that is unreachable in a way that triggers an immediate error from kernel_connect(), that error does not propagate up, instead EAGAIN is reported. This results in call_connect_status receiving the wrong error. A case that it easy to demonstrate is to attempt to mount from an address that results in ENETUNREACH, but first deleting any default route. Without this patch, the mount.nfs process is persistently runnable and is hard to kill. With this patch it exits as it should. The problem is caused by the fact that xs_tcp_force_close() eventually calls xprt_wake_pending_tasks(xprt, -EAGAIN); which causes an error return of -EAGAIN. so when xs_tcp_setup_sock() calls xprt_wake_pending_tasks(xprt, status); the status is ignored. Fixes: 4efdd92c9211 ("SUNRPC: Remove TCP client connection reset hack") Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- net/sunrpc/xprtsock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 728d65fbab0c..c9c0976d3bbb 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2363,7 +2363,12 @@ static void xs_tcp_setup_socket(struct work_struct *= work) case -EHOSTUNREACH: case -EADDRINUSE: case -ENOBUFS: - /* retry with existing socket, after a delay */ + /* + * xs_tcp_force_close() wakes tasks with -EIO. + * We need to wake them first to ensure the + * correct error code. + */ + xprt_wake_pending_tasks(xprt, status); xs_tcp_force_close(xprt); goto out; } --=20 2.14.1