From patchwork Thu Feb 11 19:06:14 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: 8284581 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 350D4BEEE5 for ; Thu, 11 Feb 2016 19:06:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30AB420121 for ; Thu, 11 Feb 2016 19:06:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 138E720364 for ; Thu, 11 Feb 2016 19:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750995AbcBKTGT (ORCPT ); Thu, 11 Feb 2016 14:06:19 -0500 Received: from mail-bl2on0087.outbound.protection.outlook.com ([65.55.169.87]:10656 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750904AbcBKTGS (ORCPT ); Thu, 11 Feb 2016 14:06:18 -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=Pl9iftCs4G7Pt2ZQV5C5OEpjaGSOnZ9+VgeRe2nhx6M=; b=b9b5ZLHpvUyWi8KvVivTkp0aYGcXAYvQy/f3WZcZ+xVacmDIxzj4R2IgbGzsDEVILTYM4M2EXaHjlM0a/ateIgCG2HSf0b+LrqsXA/+LyXwzXhDjb6Tn070ms/dWCYvYOQFH3EeHubr6ltIkZhE/iV2UJ8HAxRWR6T64IngZ1fY= Received: from BY2PR02CA0068.namprd02.prod.outlook.com (10.242.32.26) by CY1PR0201MB0826.namprd02.prod.outlook.com (10.160.141.27) with Microsoft SMTP Server (TLS) id 15.1.403.16; Thu, 11 Feb 2016 19:06:16 +0000 Received: from BL2FFO11FD025.protection.gbl (2a01:111:f400:7c09::187) by BY2PR02CA0068.outlook.office365.com (2a01:111:e400:2c2a::26) with Microsoft SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Thu, 11 Feb 2016 19:06:16 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.174) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.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 BL2FFO11FD025.mail.protection.outlook.com (10.173.161.104) with Microsoft SMTP Server id 15.1.415.6 via Frontend Transport; Thu, 11 Feb 2016 19:06:15 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by (Symantec Messaging Gateway) with SMTP id 04.3E.03682.7ABDCB65; Thu, 11 Feb 2016 11:06:15 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.248.2; Thu, 11 Feb 2016 11:06:14 -0800 X-AuditID: ac160a69-d37ff70000000e62-c4-56bcdba78be4 Received: from [10.60.52.49] ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 77.83.03361.6ABDCB65; Thu, 11 Feb 2016 11:06:14 -0800 (PST) Subject: [PATCH v4 10/21] IB/srpt: Fix srpt_close_session() To: Doug Ledford References: <56BCDAAD.7030906@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Alex Estrin" , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <56BCDBA6.2090303@sandisk.com> Date: Thu, 11 Feb 2016 11:06:14 -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: <56BCDAAD.7030906@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGLMWRmVeSWpSXmKPExsWyRoxnke7y23vCDJa94LO48PQ7k8XL8x9Y LVauPspk8exQL4vFjbYHbA6sHov3vGTy2H2zgc3j2fTDTB7v911l8/i8SS6ANYrLJiU1J7Ms tUjfLoEr4/6ENpaCraIVTQdmMzcwdgl1MXJySAiYSFxef5u5i5GLQ0hgE6PE2RUTmSCcHYwS z2+vZYSp+nb3AQtEYg5QYtFsNpCEsIC1xMG7B8BsEQE1iU2vFrGD2EICWhLP+/tZQRqYBVYx Smy6eh0swSZgJPHt/UwWEJsXqOjEy01gzSwCqhIH72wEqxEViJA43NnFDlEjKHFy5hOgeg4O TgFtiZlXIkBMZgFNifW79EEqmAXkJba/ncMMcedeVonFjxwgTlCXOLlkPtMERuFZSAbNQuie haR7ASPzKkax3Myc4tz01AJDI73ixLyUzOJsveT83E2M4NjgytzBuGKS+SFGAQ5GJR5eg1t7 woRYE8uKK3MPMUpwMCuJ8N7fBBTiTUmsrEotyo8vKs1JLT7EKM3BoiTOa92iFiYkkJ5Ykpqd mlqQWgSTZeLglGpgzHa67qTGmG56rM2hL/uFzLlq1dIDk89u2mLBVW1at8AuQdIlWff5S+sZ Z2aG/jG8kXw+6GPYh2NPPyReXu58+9q/GJbPkkWH+Nit2o5k6j5f922LZacMN39W3eJ4+b6V 72SXGmXLSR5XOHNvxprGLnEByXftgpEPzd0/7lTbYJLTzffSTX+KEktxRqKhFnNRcSIAnMSv nIkCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsXCtZEjRXfZ7T1hBo9OGFtcePqdyeLl+Q+s FitXH2WyeHaol8XiRtsDNgdWj8V7XjJ57L7ZwObxbPphJo/3+66yeXzeJBfAGsVlk5Kak1mW WqRvl8CVcX9CG0vBVtGKpgOzmRsYu4S6GDk5JARMJL7dfcDSxcjFISQwi1Hi3f2t7CAJYQFr iYN3D7CB2CICahKbXi0CiwsJaEk87+9nBWlgFljFKPF75QewIjYBI4lv72eygNi8QEUnXm4C i7MIqEocvLMRrFlUIELicGcXO0SNoMTJmU+A6jk4OAW0JWZeiQAJMwuoS/yZd4kZwpaX2P52 DvMERr5ZSDpmISmbhaRsASPzKkax3Myc4tz0zAJDI73ixLyUzOJsveT83E2M4BDljNrBeH2i +SFGJg5OqQZG/S8nXs/fuSC1iuF9xRt/9sWKbGFTeBbILFpx6HjEpjU3vkjuqjRWtenKivs3 QXbnzv8hL2SKrxSp20uzW08LM7kr8/RG83ebeW/Wn5xdqP5J9EHoJ5sN79emqCz99UL3rkmE 0ZqZ5+5P4DLa5tzg8Pbi07Zg/5qNshNuivf8+nkzI9hKdNrjfUosxRmJhlrMRcWJAKR2JE8B AgAA X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD025; 1:k2zzTqC+6SI9D6jxq9avlteDgcSOJnWTopk7EAxkZHqRLD4G22k+D+mSgVqreKmZI54KarU2NzP+E3q4FBOYBqnwL2B7YRQiEey15oNw/ej6pLxvczPV0OkBEMcTLmWyJ/QBJ9hq/NhvXZbg/y7m6wSExJrGROeeEXlOBuylb4ZIst5eui3WraJOABz5JkiVkPaIkF0gJIIIl/1uGTsAKcGbPMOMdo0XYcdmhF28SJ8usmd8OAmMdxlFAlV1L86Bo3VwuHm5rTBHMM1aSmMewRQ2qtfiAKDVGS68C/7ew5iCclKs0bDdow1tsaeEoDGdArPw6CLJECdPmdaCe6LOzchJ91v6wLo7f9s9F+E0rZ38M9O5o4B9uKpzUPAtAOHxmzoDWINL+6EVty6LfDnRwiW+ROPspS+rsikTDLKST8PZ/2WJmZultwT+mnZ+5xo4 X-Forefront-Antispam-Report: CIP:63.163.107.174; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(77096005)(76176999)(54356999)(87266999)(50986999)(65806001)(189998001)(65816999)(4001350100001)(36756003)(65956001)(229853001)(5001960100002)(2950100001)(87936001)(47776003)(106466001)(11100500001)(59896002)(23676002)(86362001)(1096002)(50466002)(92566002)(5008740100001)(586003)(33656002)(230700001)(1220700001)(64126003)(83506001)(2906002)(4326007)(80316001)(19580395003)(19580405001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0826; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0826; 2:W4by0nkhuU5L4z5KmxAMHWgXHJ4wVpH0Jgi2fcVTXODrI9emfPeNT8y6MzYU6WDVpRiVJkay99BdR7eKWgyVQbxeCtR13B/FqCffvr+WXFlNeRT5K4Wok/e4Q2QYIex9d3KnvL66ibCflijtcMBa0g==; 3:CfF2Ntl/yNgNiE1glFkx7EMTeOooB1n+ToKYyB6PB5lVqZERyVWuYFeRrSx1B4IYS0IewDsl8c8shZjy+XMH5WlR0/tDh04aNB8y0mgvb0FCHroe8fzMtoWvC4dmGcrEy+n/mTXiCCGBZG+bb27wPi3jm0WIbPiZvZbWIG/FhHHXn9pkOGm5cQPulxcaME2YvBEJraC4GZsDG0BJEbz/7v+Q8OSCvB/HBYoeOd7ZT/uVYetM5Ia3LBTzhcFY/rQJ294CQyq8jiUV18XtKuht+Q==; 25:t9LfKE03/4V501IaTmpwRsh7mSQ9P7WrVPpwtC2LMJ38wODKNdn4Fy2diV9/AlqUEZKHJbRP4aamJ/opjyQHIJeyylSoOLfdhhleourO06U2H0YHN0uEB9eJx0/uVZ5Z14DIAHLqtA5cUYK0FkEdsMladReD3sw7wMRKZrBKe9FzQaB4411Uf/lI6h7+9YYvaGM0EhbK7+xC0rVAC5Ce4MjofoMXCwuqj/j7TiJrpNEBhjiFnSsZSDqOKZHID6hnmeJlD54nICf/9geilusFTHd3/rOlKVFE4nOz9qXty+J8dhsX2YBDkOuWpxs6tQAy X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:CY1PR0201MB0826; X-MS-Office365-Filtering-Correlation-Id: 1b6ede86-485e-4570-32ae-08d333166a82 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0826; 20:SvAcGucb+GfifPU3U9Jr9mYTfSK6xL+fFBragfC0uJnbMJq2GaV6BzWcGJZYCiTzHRP/0aO9jnAfhEtdh8LKOVoDrhX75/E40o+OBOLsbAdbJgTFJpB/TYQb6B5MN2C3V46/79dU4K/6YOL6iIWLcFC+cNM4Ryp0jA0Y/inP/xrQCJi/+mmDcoPzbu32Jc2fb7PWGQUathG+Qhd52pbMi/GV6xLxgXFtxsrRDkagjLIj5fzz3d6Y4hveUelMOzTpljh2mG2LZRPRUcbatmsn3uk7uow54+TnMcXhT16rvMHz0rLRSBV76C/rskFYenN/R4+tY1LlcYLLVNPabDZ6rPMH2T0pvsIGwqCRc+4t5tQrKfZeq9HEd9ySf9l7mH3snhYQQlyMiTTc+kazDYsvht7huBmbUbNCnGWXGXJe3TkWKxXwnkMCiwhsIAEU17r2sTQzoqJd/N4IAlzUkFbyCLMYSK5TCIY7ygMMaSU+9ROf7c0NX750uJCR2Dp3G34o X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13018025)(13024025)(13015025)(13023025)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY1PR0201MB0826; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0826; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0826; 4:SEYfDZNJJpIVLEvaMmuDt2/cC2gMW/yx5WP2Aedf7UQ5Z8ZTo3VSpVDYU37/s2e8VaB+IP4FLyKBuCc8LcfwAwI27EC9+bsqArq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VEdJSnc5STVhdDZvV3VQYlB1TXppVXIzUnha?= =?utf-8?Q?BetnY5bdeDiIPOslF4It1kGN93Ob5?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0826; 5:tW+SyuuWIKSLxfVEKtiPBqqLr4IaHJ2HzarNCfJNjlYnbluPyZj3wE6SwH4isYMOsAqJpckpw50elOYxb+owyYiYA81xUu62w4aKyph7u+MTXJHG8pXCRQqAK6Rf3f1NiHUys42j4TxFfFtRxDfBVw==; 24:x/4NhP5FU5zHl8Txq+kRTB3yJIxZH/J58klyp58Jp4Wce+11h4Rx+M5gczdg2HH+l4W0iJKTXUe6bjowY6GrOwV9jStolMyoi/fcTGMc0Ng=; 20:OzcjcugSL3DqlfQyLuZ6bLzM4+Z2H0N2TdSo0XaXNmZWI73e2LmDME30alZQRi0Rrf4suLBglxeNzg9UBGlMf4Q1+DVY4Sz1eRgy0ojtPynvFOqBrTCnJ4/OOkDUkQwK6jXP4AluMtfoTKB6GvPjDykMoubLl+xKKwj6RO63z09TnTK+voAmW4bmK6xUWmzrtG+7037Clzgts6zhRZtfzGXckftnlJiKckS9rJjEdnK3nJ5PNBrufgCHjLkcEMof SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2016 19:06:15.3282 (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: CY1PR0201MB0826 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.0 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 Avoid that srpt_close_session() waits if it doesn't have to wait. Additionally, increase the time during which srpt_close_session() waits until closing a session has finished. This makes it easier to detect session shutdown bugs. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Cc: Alex Estrin --- drivers/infiniband/ulp/srpt/ib_srpt.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index bffca47..d644606 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1986,8 +1986,8 @@ static void srpt_release_channel_work(struct work_struct *w) struct se_session *se_sess; ch = container_of(w, struct srpt_rdma_ch, release_work); - pr_debug("ch = %p; ch->sess = %p; release_done = %p\n", ch, ch->sess, - ch->release_done); + pr_debug("%s: %s-%d; release_done = %p\n", __func__, ch->sess_name, + ch->qp->qp_num, ch->release_done); sdev = ch->sport->sdev; BUG_ON(!sdev); @@ -2011,11 +2011,10 @@ static void srpt_release_channel_work(struct work_struct *w) ch->rsp_size, DMA_TO_DEVICE); spin_lock_irq(&sdev->spinlock); - list_del(&ch->list); - spin_unlock_irq(&sdev->spinlock); - + list_del_init(&ch->list); if (ch->release_done) complete(ch->release_done); + spin_unlock_irq(&sdev->spinlock); wake_up(&sdev->ch_releaseQ); @@ -3025,24 +3024,26 @@ static void srpt_release_cmd(struct se_cmd *se_cmd) static void srpt_close_session(struct se_session *se_sess) { DECLARE_COMPLETION_ONSTACK(release_done); - struct srpt_rdma_ch *ch; - struct srpt_device *sdev; - unsigned long res; - - ch = se_sess->fabric_sess_ptr; - WARN_ON(ch->sess != se_sess); + struct srpt_rdma_ch *ch = se_sess->fabric_sess_ptr; + struct srpt_device *sdev = ch->sport->sdev; + bool wait; - pr_debug("ch %p state %d\n", ch, ch->state); + pr_debug("ch %s-%d state %d\n", ch->sess_name, ch->qp->qp_num, + ch->state); - sdev = ch->sport->sdev; spin_lock_irq(&sdev->spinlock); BUG_ON(ch->release_done); ch->release_done = &release_done; + wait = !list_empty(&ch->list); __srpt_close_ch(ch); spin_unlock_irq(&sdev->spinlock); - res = wait_for_completion_timeout(&release_done, 60 * HZ); - WARN_ON(res == 0); + if (!wait) + return; + + while (wait_for_completion_timeout(&release_done, 180 * HZ) == 0) + pr_info("%s(%s-%d state %d): still waiting ...\n", __func__, + ch->sess_name, ch->qp->qp_num, ch->state); } /**