From patchwork Fri Jan 29 23:19:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 8168701 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D7119F96D for ; Fri, 29 Jan 2016 23:19:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89AD320340 for ; Fri, 29 Jan 2016 23:19:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7293E20328 for ; Fri, 29 Jan 2016 23:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753591AbcA2XTJ (ORCPT ); Fri, 29 Jan 2016 18:19:09 -0500 Received: from mail-by2on0083.outbound.protection.outlook.com ([207.46.100.83]:39522 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753204AbcA2XTH (ORCPT ); Fri, 29 Jan 2016 18:19:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6NZbxXJzGlVPYKTUxJiaXu62xa21lqj4GK2WZ91YoEM=; b=ZERQyNpzCZ5pM9KE2U8OO45CCScpD71TqwJ0w9l2MLu8T3y7M6eGgHKq6ZKHiZtnJKkzAAeteCPDJ61q6wbxPRXArV76y/7LXfyU4Mhz49Ni+SISo/AABn8Y2eaHKlut+BS0JfhKXBC5pMx9VsJ9S7k42L8reAw85Qq1hbo9i2w= Received: from CY1PR0201CA0004.namprd02.prod.outlook.com (10.163.30.142) by CY1PR0201MB1578.namprd02.prod.outlook.com (10.163.140.13) with Microsoft SMTP Server (TLS) id 15.1.390.13; Fri, 29 Jan 2016 23:19:03 +0000 Received: from BN1AFFO11FD050.protection.gbl (2a01:111:f400:7c10::134) by CY1PR0201CA0004.outlook.office365.com (2a01:111:e400:58b9::14) with Microsoft SMTP Server (TLS) id 15.1.396.15 via Frontend Transport; Fri, 29 Jan 2016 23:19:03 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.174) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.174 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.174; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.174) by BN1AFFO11FD050.mail.protection.outlook.com (10.58.53.65) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Fri, 29 Jan 2016 23:19:02 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by (Symantec Messaging Gateway) with SMTP id 02.E8.25823.663FBA65; Fri, 29 Jan 2016 15:19:02 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.248.2; Fri, 29 Jan 2016 15:19:02 -0800 X-AuditID: ac160a69-633ff700000064df-de-56abf3665bef Received: from [10.60.52.49] ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id ED.AC.03910.563FBA65; Fri, 29 Jan 2016 15:19:01 -0800 (PST) Subject: [PATCH v2 22/22] IB/srpt: Fix wait list processing To: Doug Ledford References: <56ABF16E.7070006@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Alex Estrin" , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <56ABF365.1020708@sandisk.com> Date: Fri, 29 Jan 2016 15:19:01 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56ABF16E.7070006@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGLMWRmVeSWpSXmKPExsWyRoxnkW7a59VhBn1v2S0uPP3OZPHy/AdW i5WrjzJZPDvUy2Jxo+0BmwOrx+I9L5k8dt9sYPN4Nv0wk8f7fVfZPD5vkgtgjeKySUnNySxL LdK3S+DKmLbgGFPBfYmKtnatBsYW0S5GTg4JAROJed/msXUxcnEICWxilFix6zQ7hLODUeLd 5QZGmKr7ez8wQyTmMEocnjmRFSQhLGAtsefUKrAiEQE1iU2vFrGD2EICWhLnLnwBm8QssIpR YtPV62AJNgEjiW/vZ7KA2LxARX+6j4HFWQRUJS7N3gs2SFQgQuJwZxc7RI2gxMmZT8DqOQW0 JZbMvgBkcwAN1ZRYv0sfJMwsIC+x/e0cZohD97JKbP+qA3GDusTJJfOZJjAKz0IyaRZC9ywk 3QsYmVcxiuVm5hTnpqcWGBrpFSfmpWQWZ+sl5+duYgTHBlfmDsYVk8wPMQpwMCrx8C5YsTpM iDWxrLgy9xCjBAezkghv3QugEG9KYmVValF+fFFpTmrxIUZpDhYlcV7rFrUwIYH0xJLU7NTU gtQimCwTB6dUA6P79PlH7av/WH5xbrY/k7CtXyqyarupnn7m1bxzJj2s2cZe21cyfGw+Ieom 3POzNaFixipTh79v/3X5ZT3lvSJ/pPTgzcp87vf3p/xj/Bn0cWEvc4Hyidcng74lPGA3DbiU 92POsyLLgvlnP5zXOD4p6NAb+afZs0tdL054sT33EF8vY3vNdEMlluKMREMt5qLiRADwsGu3 iQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsXCtZEjRTf18+owg/OnTS0uPP3OZPHy/AdW i5WrjzJZPDvUy2Jxo+0BmwOrx+I9L5k8dt9sYPN4Nv0wk8f7fVfZPD5vkgtgjeKySUnNySxL LdK3S+DKmLbgGFPBfYmKtnatBsYW0S5GTg4JAROJ+3s/MHcxcnEICcxilOi9cIwVJCEsYC2x 59QqRhBbREBNYtOrRewgtpCAlsS5C1/YQRqYBVYxSvxe+YENJMEmYCTx7f1MFhCbF6joT/cx sAYWAVWJS7P3gg0SFYiQONzZxQ5RIyhxcuYTsHpOAW2JJbMvgNnMAuoSf+ZdYoaw5SW2v53D PIGRbxaSlllIymYhKVvAyLyKUSw3M6c4Nz2zwNBIrzgxLyWzOFsvOT93EyM4RDmjdjBen2h+ iJGJg1OqgXHzZis3o2pGRgXLzafusnyz6Gkx/XRdZqLeHm+/syedN2YILfMT37PG11VJS1Oj oz7shO7slknT25Yt+zrLM7439dbnAGXV+Yc6Xr6aflbY6rJvoFTogtW5j56uebe24xs/87lf gtKfRRwZTi1RfHzrarAD36qZ1sG7TmoLuJ6ee9kga8Pj+KNKLMUZiYZazEXFiQDRvCgAAQIA AA== X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD050; 1:dj5h0BhJZK+ifP22w0siYZcUNqrR6ZrK5Nf/NN510xhEZfjQEHsnyGH/2MXk8ZZQndx85KDuE2mlyMcL07/WbItCrabGRYK5DqxYO/QCDf0alBUjms3NZqSNrSfgSfeKneOqR5Lwdokd68bgK7+9gp2iYkL7XoV3KbXyQkudS+6YMWvDnAAwTcK7F/FHFp3SOfnFW9M102TY+7Ud7u7lHOSpAVRsqDitI55fidFP8jkiLwT46Uuv9UI6pQnCBDFlT/MwP85RyEK3M3mvwtJs5bWwHwRYIvXGDhiRjwaRVfeSZb0pa4JsqdhY85KkecPQKBcb0l2j5MzktTLIs0SJe7TUPi/x/TfTAqgpDza38ZuCLgsMW0h14JQzKrvJFbMnhn+VMZ10DeKJdt7xcl8XOD0dKjoUioduW7OcodMHEOrkoaET5zMl+u72rXtKp+Mz X-Forefront-Antispam-Report: CIP:63.163.107.174; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(2980300002)(438002)(189002)(199003)(23676002)(11100500001)(33656002)(36756003)(64126003)(5008740100001)(586003)(1220700001)(1096002)(4326007)(92566002)(2906002)(54356999)(19580395003)(19580405001)(110136002)(230700001)(59896002)(80316001)(76176999)(65816999)(87936001)(47776003)(4001350100001)(50466002)(65956001)(2950100001)(86362001)(229853001)(189998001)(77096005)(83506001)(5001960100002)(87266999)(50986999)(65806001)(106466001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1578; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 2:NqNSqjiUXBuQfelyQmc1uk/cm8GJMN+gKbUEuMRFArH9Jqa64zmSOxFfp3IV2jYDlKhU0yMmBGbtRhBHmW6z8DiSXO6QpuNQNURkYsfv+8cucoCfDA+8F0rzM9kVluUK8fCaSMmcuM/52whfykCEAw==; 3:yI6wcjdIeVDxaduNYd2RWx01UdfdhXz0cRv/FHFx+FH7H0kuCZrfdxVv88v8fVvJGOsUkerbCF/ZBOska9zhZSbhKWm20FEg08ne6RjfUeFD8cF8r4KMiCY4AoYIwdh3NI1PCspx/J8PJOiL89OgOxCguzDyY8FReV4yRP08DyQBmbLCdWzOicWjEu5eWeiTFmGb9tuoC5O0PZnGANN3dlvTVoDhGmA9sznVZ78YbA5Ibdanobhy8gYOV0sOCmcJV3+1GQ5woCVuhw0bXkmDZQ==; 25:CvAdJcFsE3bJxsqakw41k2PfjrkC5qCXNDXBT7cARFVT2a/TUEjfwRuPEWmbj0tdbpb2j8GiS7HRsIMHFlSHEj80Z275t9M4sDqjYo3eWMe0XRRa/fLD8r30AmiHWHBo0jHW+TqCqXguMXdc1c/Id84/8Jx319YxDNQPV1xxSNVlL1sA00WkCQQnDG3hv/ay2v19m5U9MdRgzkKmz0lFsgBDQTRVsIbCcProoshGWFRydccoFwfDiReY7R9Eqg8u X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:CY1PR0201MB1578; X-MS-Office365-Filtering-Correlation-Id: b26963ec-da41-4b8e-e0de-08d32902934c X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 20:CIurFIp8Et26M1xEIifWdcMNcV43ByMF3RpiuRsUwq7xR3hyJhQs+eFFJv/eV3FkTQ5a+TwhqkDkfIBINQN0TAawdDmsWCayKakmMrRWi0fmeXKJHBOxg12a8FYLbXk8G5u+3dTQC6riCtcNWVoOS9ErOzn7MXN8MUF2KwZsp4HlEsXF7JJxgj15X64wnE7CNTzuXmjnLrr0afLYP2Clwp4ETaWhiJCYwxqQjX5xe6aKvAY/NcMtEA99CjbCuDC+8dKcGquoX6F6N8UHpG5NJiLLRa5t9xSqSY5tmMtp7GTsL02tcazO0oGa211vNGdR6koQ9VeH86aWX53BstFB2Qa2Ff2S7V24EHphS2CJuPPfUdYxYi/e4SSqmjs11q1dqZLg1VrfSFdiMWqfZShuqAvrDEIHWvA8sNeKn9AJxPY6hpCni89WWGUCarkTExSWIYwudvx0gkmkW8G51TDXFg6qbOZqk5/9OO/tR4x0No4q2LTvrBebye5AvaVt2MM2 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(34787635062028)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13024025)(5005006)(13017025)(13015025)(13023025)(8121501046)(10201501046)(3002001); SRVR:CY1PR0201MB1578; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1578; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 4:+udH7jKCD1ppJhn+3Ido1Ug8M/w8ms7KFwilBxg0ud4QOPOnGrnxBwqIhkJA91g3xmhn+YWzPG6XM9HwXqPNDDwhq/JQKnzQd7E5LOtwkf+nP/kKpRO4WsDr/SjYoZlQ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zejRsWG0wWGdTNnNUWTRtcWVp?= =?utf-8?B?bzBoNVZRYmw5OTJkSStUWlpFVU1HQ3d4RmZEZFdUbkdDbVoxRUFqVHBCTDcx?= =?utf-8?B?TEZOUS8yYnhjRWRvMzZHQVZKQWcvMy93dlVuREVHdHZ5dFlhcWZUQkQ0NGo0?= =?utf-8?B?YUdsZ1gvWVA2ZEd1Z0d2MngraUJMU3JBYzN6UHphbkhlNmJWUFZtS0VvYUpZ?= =?utf-8?Q?gBveR25SBtmqkZdh78RQLq?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 5:MH6DM8BXDSw6ATRbaDgFu5X/Zssj6pLkaxft2ywx7hlGmQK5Jki3YDAB2VMGuhayx9kxQ7oKXTZ/N4rz9YwJkovNXXGvI704y2Olxa/sdAF3op9nc7FVSiQG5es1yQpH9r6KuTu9DwPbIYhTR12yvA==; 24:2e5uLxBIIBQOkTnrJFZ4ShizpXj26rVYQjFQaH2HHPU0i7RkBtM9oYfI3zM+zn+hbOaLQ/8SyIIXmVyz6dduwE6VmfBuLJiwOuaxF0GfLf8=; 20:2TxvUCFp+7pL/tvMs656vcMFaEizkBfmqWVTvw0ywockazXu7cGJQkSZ1usQ63T6U0KenQuv1OAYEk8lPnpgF/Jlcz9mYZrCgcFjcnAtmS+M2GbljknOLRMLkdtVWOlgm19k7hAR9a7+BozvpYOt8xOkZGxbwTglSrJgFHS3mPK1SxBjkpAhgRwZlwjFN7RZ04fupwtlXGW6Ky+xSa2pvPVycD/+GENXV1X+PWIpZe6iVv2X+jltbe5hNHbTF0O8 SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2016 23:19:02.2186 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.174]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1578 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since the wait list is not protected against concurrent access it must be processed from the context of the completion handler. Replace the wait list processing code in the IB CM RTU callback handler by code that triggers a completion handler. This patch fixes the following rare crash: WARNING: CPU: 2 PID: 78656 at lib/list_debug.c:53 __list_del_entry+0x67/0xd0() list_del corruption, ffff88041ae404b8->next is LIST_POISON1 (dead000000000100) Call Trace: [] dump_stack+0x4f/0x74 [] warn_slowpath_common+0x8b/0xd0 [] warn_slowpath_fmt+0x41/0x70 [] __list_del_entry+0x67/0xd0 [] list_del+0x11/0x40 [] srpt_cm_handler+0x172/0x1a4 [ib_srpt] [] cm_process_work+0x20/0xf0 [ib_cm] [] cm_establish_handler+0xbe/0x110 [ib_cm] [] cm_work_handler+0x67/0xd0 [ib_cm] [] process_one_work+0x1bd/0x460 [] worker_thread+0x118/0x420 [] kthread+0xe4/0x100 [] ret_from_fork+0x3f/0x70 Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Sagi Grimberg Reviewed-by: Christoph Hellwig Reviewed-by: Alex Estrin --- drivers/infiniband/ulp/srpt/ib_srpt.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 5185eca..08a30c6 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -96,7 +96,7 @@ static void srpt_free_ch(struct kref *kref); static int srpt_queue_status(struct se_cmd *cmd); static void srpt_recv_done(struct ib_cq *cq, struct ib_wc *wc); static void srpt_send_done(struct ib_cq *cq, struct ib_wc *wc); -static void srpt_zerolength_write_done(struct ib_cq *cq, struct ib_wc *wc); +static void srpt_process_wait_list(struct srpt_rdma_ch *ch); /* * The only allowed channel state changes are those that change the channel @@ -833,12 +833,14 @@ static void srpt_zerolength_write_done(struct ib_cq *cq, struct ib_wc *wc) { struct srpt_rdma_ch *ch = cq->cq_context; - WARN(wc->status == IB_WC_SUCCESS, "%s-%d: QP not in error state\n", - ch->sess_name, ch->qp->qp_num); - if (srpt_set_ch_state(ch, CH_DISCONNECTED)) - schedule_work(&ch->release_work); - else - WARN_ONCE("%s-%d\n", ch->sess_name, ch->qp->qp_num); + if (wc->status == IB_WC_SUCCESS) { + srpt_process_wait_list(ch); + } else { + if (srpt_set_ch_state(ch, CH_DISCONNECTED)) + schedule_work(&ch->release_work); + else + WARN_ONCE("%s-%d\n", ch->sess_name, ch->qp->qp_num); + } } /** @@ -2318,9 +2320,13 @@ static void srpt_cm_rtu_recv(struct srpt_rdma_ch *ch) if (srpt_set_ch_state(ch, CH_LIVE)) { ret = srpt_ch_qp_rts(ch, ch->qp); - srpt_process_wait_list(ch); - if (ret) + if (ret == 0) { + /* Trigger wait list processing. */ + ret = srpt_zerolength_write(ch); + WARN_ONCE(ret < 0, "%d\n", ret); + } else { srpt_close_ch(ch); + } } }