From patchwork Wed Aug 12 16:50:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 7003281 Return-Path: X-Original-To: patchwork-linux-scsi@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 7F26A9F39D for ; Wed, 12 Aug 2015 16:51:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 547B6206FD for ; Wed, 12 Aug 2015 16:51:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FFF1206FC for ; Wed, 12 Aug 2015 16:51:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932116AbbHLQvA (ORCPT ); Wed, 12 Aug 2015 12:51:00 -0400 Received: from mail-bl2on0075.outbound.protection.outlook.com ([65.55.169.75]:55638 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753241AbbHLQu7 (ORCPT ); Wed, 12 Aug 2015 12:50:59 -0400 Received: from CY1PR0201CA0037.namprd02.prod.outlook.com (10.163.30.175) by DM2PR0201MB0749.namprd02.prod.outlook.com (10.160.94.25) with Microsoft SMTP Server (TLS) id 15.1.231.21; Wed, 12 Aug 2015 16:50:56 +0000 Received: from BN1BFFO11FD053.protection.gbl (2a01:111:f400:7c10::1:161) by CY1PR0201CA0037.outlook.office365.com (2a01:111:e400:58b9::47) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Wed, 12 Aug 2015 16:50:55 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; clodo.ru; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BN1BFFO11FD053.mail.protection.outlook.com (10.58.145.8) with Microsoft SMTP Server id 15.1.243.9 via Frontend Transport; Wed, 12 Aug 2015 16:50:54 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id 98.6E.06265.E697BC55; Wed, 12 Aug 2015 09:50:54 -0700 (PDT) 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.224.2; Wed, 12 Aug 2015 09:50:04 -0700 X-AuditID: ac160a69-f790f6d000001879-fb-55cb796e8721 Received: from [10.60.52.33] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id 74.1A.04661.D697BC55; Wed, 12 Aug 2015 09:50:53 -0700 (PDT) Subject: Re: threads scsi_eh_ and scsi_tmf_ don't die when ib_srp reconnect To: "kkv@clodo.ru" , "linux-scsi@vger.kernel.org" References: <55C8C0DC.7070505@clodo.ru> <55C8C39B.1010000@sandisk.com> <55C9FB62.1030004@clodo.ru> <55CA5AD4.8080109@sandisk.com> <55CAD674.4040104@clodo.ru> From: Bart Van Assche Message-ID: <55CB796D.3030709@sandisk.com> Date: Wed, 12 Aug 2015 09:50:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55CAD674.4040104@clodo.ru> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJLMWRmVeSWpSXmKPExsWyRoxnkW5e5elQg6YFLBZ9P5oYLbqv72Bz YPJY17SNxePzJrkApigum5TUnMyy1CJ9uwSujCkbetkKfvBWtO96w9zAuJO7i5GTQ0LAROLj msV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jXVJXqf74FLn8ft1J3n2+IQU3r1szHFBd+0Y/4GnpL46PDnxBGxxv3ZJlD1uh L/ho9+95LVmJEmqPNrTc4fL9LLp8l6D0sYyKFwvuykkb/r+31lz0ZVdgwiulbI6HH2QEdIW5 lFiKMxINtZiLihMBaPHcO+MBAAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD053; 1:jUNCwM+JQbHDu+To5n3Fi4bdPf1ql4AqSVX7kelB4l/70VbcyPjvjdIzkL+VBT85ITUSZV/YUOo2tXKg7fEHRUTf3Q7ymzoIsiK1xS3atBu73cftjlcoB9RP7TKFZqm3uBWoK1FjKiKipGhaDG630ck28/ioWimJRI7ixyBZMUhFT0tgyh4gZ/oHTWcyyCrBahLF5CibqLm3CJ5HdIP/cnCrpnjF69IGONqTzJl4soTWFgUowLDZO/RQNU4VC5WVsXodiRJD1zeP9wc6aLfOGMmqtqiten6t85GbWrKKrztKl7uaaFk61I5xUkdBYQAOC4EcHpRBvwHMazYJjJuJiw== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(3050300001)(164054003)(24454002)(479174004)(199003)(189002)(377454003)(68736005)(2950100001)(77096005)(106466001)(2501003)(69596002)(86362001)(87936001)(65806001)(65956001)(83506001)(50466002)(47776003)(93886004)(64706001)(59896002)(65816999)(64126003)(92566002)(46102003)(77156002)(97736004)(36756003)(50986999)(19580405001)(80316001)(189998001)(23676002)(19580395003)(107886002)(4001350100001)(62966003)(5001920100001)(87266999)(76176999)(4477795004)(5001860100001)(33656002)(54356999)(5001830100001)(5001770100001)(5001960100002)(4001540100001)(81156007); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0201MB0749; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:ErrorRetry; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0749; 2:28N9/r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a8DMiwGZ9XwlMilNVl4X8lzV59hi6Oe1LR9Bvr7xI70frQkRUXXMxBF24SXDFiJmtC2KV2Jy2Ze41qSfW52OItPuHoIw4ARsGF3w9+22E2rG8B32eJybtsQ2yDWlAD45+XPq32IGdOLuM4q0/huiiT+iOoRZj19insjeX7b1TH4RvMgkSB48SvHdiWvdex14NQYF3HqIe/ZirEgYU97qcvG2jrTOJ2dDbTrbaJJgNi9feabRsGQ1poWUn+Aw4YI; 4:R8XdP3F6HQ0dX5QArSaKLBPu6BZqCeypaus2MAHw/TkJG6uBljQLYq3O3vgit7Ezs7Z0Rw2CLSXfEpLSpy0LOUl0nfktGHQGN+7XM7t7IitZgLx2YnPsvewWg8+cHM/GBvNQYaUOZPGVwWePSoiYwlwdgII/dbB6vi63uxTZ342HzlMjiq0+9y2HZsPsn+knJG3sucsrWRikKURfTj1b0ytz/ScNh5OWhRHPInuRx39gL/+FB3+XPo5Am4+kDK5K3fU/57CJhNdCQXGlWvvrxjU44DyO57vKtn98mPxkgzI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR0201MB0749; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0201MB0749; X-Forefront-PRVS: 0666E15D35 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTJQUjAyMDFNQjA3NDk7MjM6NnZzVmczaGV0MWEzZ1FwbGNibTdjRTM1?= =?utf-8?B?S0ZheHQydDROa0lIcWtzSkl4RHBQWm9waytUelFYaE5MTldOT1hCRUFKTkZz?= =?utf-8?B?bFdVMG8zK3VVY3N6bTlpTkttUE1ITmhoczZSc0FaL2tFZUdXdmQ1ZlhKcmVs?= =?utf-8?B?Uit2cUZ2QjQvUmdoZEkza3RnaU8zT0JUTjEyQlBvWGEzSFJXL0xzWmoreVBH?= =?utf-8?B?VkRwRVdvOS81NUZRR3JWU3hCSlRX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OiM7Attgk3aD6sXdVD/gLfS1Tjk98FUArnyma8UzFtTXNc74KQK1/oijcltL5tzcQ==; 24:MW7pwX2KhlhFwUFDTKEvxHRi1Jd3fetPLXhds8wejvxsQM3TErjsR7hPooxciekOW3gyCFbOalTin+3ZecdobsnxZRv7H4CgDWor+cFEawA=; 20:OFZTz1mKV47LHUbwdresuxtp3M6/qIQQ42LkUGuMM0V0azte/AdPk9PB/pZJnQBB2LGj2lTpzyw2jg5LU1K6LlbD0+PqWyjmORTiMq/emHkaI5f5JUu9YFpW6kXgE7JS3+71J/OnzIuiKeMie03NJQuDhV1vsoPVO9JqK+n4IUo= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2015 16:50:54.3693 (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.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0201MB0749 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 On 08/11/2015 10:15 PM, Konstantin Krotov wrote: > 11.08.2015 23:28, Bart Van Assche ?????: >> Are you using a kernel from Greg KH's stable repository or another kernel ? And to which values were the > yes, sources from upstream, 3.19.1 Hello Konstantin, Can you test the patch below ? That patch not only applies to the v4.2-rc6 kernel but also to the ib_srp-backport driver. Thanks, Bart. Subject: [PATCH] IB/srp: Stop the scsi_eh_ and scsi_tmf_ threads if login fails scsi_host_alloc() not only allocates memory for a SCSI host but also creates the scsi_eh_ kernel thread and the scsi_tmf_ workqueue. Stop these threads if login fails by calling scsi_host_put(). Reported-by: Konstantin Krotov Signed-off-by: Bart Van Assche Cc: stable --- drivers/infiniband/ulp/srp/ib_srp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index f962267..b5f9456 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2765,6 +2765,13 @@ static int srp_sdev_count(struct Scsi_Host *host) return c; } +/* + * Return values: + * < 0 upon failure. Caller is responsible for SRP target port cleanup. + * 0 and target->state == SRP_TARGET_REMOVED if the target port will be removed + * asynchronously. + * 0 and target->state != SRP_TARGET_REMOVED upon success. + */ static int srp_add_target(struct srp_host *host, struct srp_target_port *target) { struct srp_rport_identifiers ids; @@ -3316,6 +3323,7 @@ err_disconnect: } kfree(target->ch); + scsi_host_put(target->scsi_host); goto out; }