From patchwork Wed Jan 25 23:36:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9538161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE1CA6042C for ; Wed, 25 Jan 2017 23:37:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E488E27F17 for ; Wed, 25 Jan 2017 23:37:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D95E827FBB; Wed, 25 Jan 2017 23:37:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7001427F17 for ; Wed, 25 Jan 2017 23:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752329AbdAYXhb (ORCPT ); Wed, 25 Jan 2017 18:37:31 -0500 Received: from mail-cys01nam02on0066.outbound.protection.outlook.com ([104.47.37.66]:2406 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752237AbdAYXh1 (ORCPT ); Wed, 25 Jan 2017 18:37:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vjNGyfpwHr43HmmGGWLkWYQRH1PYy0i82YJo6Rx1QXw=; b=EjiDG8t89WLFZgQXvAouwIvsQpAjxIWFoEdtYn7sOpuyIPhuzJS4n2p750VL6/dJqWs9vYjk3P9FTJRsRClGlpHnhhkX8lqmVXUx6frOelDx1PULJH5P6bwmYSf32uU0E9CiT9FmuDQSEAh4DZ7vhkVb+vQtFJHSCDBljRd8Nf8= Received: from BY2PR02CA0106.namprd02.prod.outlook.com (10.163.44.160) by BLUPR02MB034.namprd02.prod.outlook.com (10.242.191.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 25 Jan 2017 23:36:57 +0000 Received: from BN1AFFO11FD045.protection.gbl (2a01:111:f400:7c10::151) by BY2PR02CA0106.outlook.office365.com (2a01:111:e400:5261::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12 via Frontend Transport; Wed, 25 Jan 2017 23:36:56 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN1AFFO11FD045.mail.protection.outlook.com (10.58.53.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Wed, 25 Jan 2017 23:36:55 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id E9.C8.65426.5C339885; Wed, 25 Jan 2017 15:24:54 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 25 Jan 2017 15:36:49 -0800 X-AuditID: 0ac94369-b62949800001ff92-2b-588933c59400 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 8B.35.16817.19639885; Wed, 25 Jan 2017 15:36:49 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , "Andy Grover" , David Disseldorp Subject: [PATCH 15/34] target: Fix a reference leak in transport_cmd_check_stop_to_fabric() Date: Wed, 25 Jan 2017 15:36:27 -0800 Message-ID: <20170125233646.2243-16-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170125233646.2243-1-bart.vanassche@sandisk.com> References: <20170125233646.2243-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsXCddJ5ke4x484Ig7+vuCz2z3rGZPH1/3QW i5WrjzJZtC59y+TA4rH7ZgObx/t9V9k8Np+u9vi8SS6AJYrLJiU1J7MstUjfLoEr4+C6fcwF Hzkqzjw2b2A8zN7FyMEhIWAiMedXRBcjF4eQwFImiUcvrjB2MXICOTsYJWb8NQKxQWruTGhh hyjayCjxsPENE0iCTcBI4tv7mSwgtoiAgcTv3guMIEXMAh2MEvN7nrGCJIQFoiW6n38Cs1kE VCV2nP/IBrKZV8Be4vRCZogF8hK72i6ClXAChVvP/mSBOMJOYv2BViaQmRICTawSG/78B1vM KyAocXLmE7AiZgEJiYMvXjBDNKhLnFwyn2kCo9AsJGWzkJQtYGRaxSiWm5lTnJueWmBoqlec mJeSWZytl5yfu4kREtSZOxjvPvE+xCjAwajEwyuwpSNCiDWxrLgy9xCjBAezkgjvOrnOCCHe lMTKqtSi/Pii0pzU4kOM0hwsSuK8bve+hAkJpCeWpGanphakFsFkmTg4pRoYM869MT+c9KFm UbPdnt3lu7pWFy/kOsHJe/xD0HT224E9DtlPq9+f+Lpru0+90bruzhJHJclnDipN7Ie/Oxrp Nh/mWuv7JnCr0n7jL9b/xP47eK3ZvPizZ/fWhxsOb2i6tPhoTFz21seZjdJbE8PnWCbk79r7 TC4roWZrps2s4iuXDQ7178w5o8RSnJFoqMVcVJwIAM3v/L5mAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTXeiWWeEwckZhhb7Zz1jsjj4s43R 4uv/6SwWK1cfZbJoXfqWyYHVY/fNBjaP9/uusnlMW3OeyWPz6WqPz5vkAlijuGxSUnMyy1KL 9O0SuDIOrtvHXPCRo+LMY/MGxsPsXYycHBICJhJ3JrQA2VwcQgLrGSWmbuhnBkmwCRhJfHs/ kwXEFhEwkPjde4ERpIhZoItRYtOZU2DdwgLREt3PP7GC2CwCqhI7zn9kA7F5Bewltmy+xAqx QV5iV9tFMJsTKN569ifYUCEBO4n1B1qZJjByL2BkWMUolpuZU5ybnllgaKhXnJiXklmcrZec n7uJERIQkTsYn040P8TIxMEp1cB4oSRjMb/WlfluiwRcpniV1K+7cOXmMr+HUvMfBfz/ckaB LXfBXT6hr5x7zfcma+o8StvI85ZD6YvJ+WlaV9MSjjm8nrhB/cANJf8/t068y420unZk9UQx 7/W/TAv6bHs2375lOjt/4XPmnfLX1HSEAz5ryCXsfXZ847TYrr1fJrDd+nAk0IG7W4mlOCPR UIu5qDgRAHtGQIW4AQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39850400002)(39840400002)(39450400003)(39860400002)(2980300002)(438002)(199003)(189002)(68736007)(92566002)(81156014)(110136003)(50466002)(50986999)(8936002)(1076002)(81166006)(7049001)(47776003)(2950100002)(38730400001)(97736004)(48376002)(6862003)(50226002)(1691005)(6666003)(2906002)(36756003)(5003940100001)(189998001)(76176999)(53936002)(6200100001)(33646002)(106466001)(69596002)(4326007)(626004)(356003)(54906002)(86362001)(5660300001)(77096006)(2270400002)(8676002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB034; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD045; 1:XrIYaCo8TNCRxNPoGmEoS2aLssqQiUHJgnFaocTDl2SxGOGKn1UshqnvyFr9Q2+oCv7Z3tCKS7dEGRgae5v0EWmdowTHjAvXhSCI8kFr7o8VArXHtFbp1ZXicl8FDWK/TdrdbeYjXEJffFD3GBpRu9gSXnpBPYx9Bl7iSRge08I2CHl6bMCsU7zxzr4S2yKOnnobN7++nQRua3QGlbWf5eRlU49oE+fTLFMYJdGDx42dNubWko+ckFUSZdek7VN7tZVzPyWU3PisehUKGJsDn0myvxVABfi74iR3CyM1D1UceI9FZZkcYPofk7IKGB5VMnyfq96Ly75kaSrCw566U26UwZAAukavce1ItmJXbLFxv+oHSXcabnwcfhlsoSk91T5pdAbhxxs587cvKgty25JLpCpweQ9aZskc6XziQ5S4RTiVQcNnU95di/0mFIpDsb31pgFTp6xWrWzawGP2UeP4bkvdgXO6J2CLJEXKFkOauakQ1jn3vkndPetOithm X-MS-Office365-Filtering-Correlation-Id: 6bd6b754-3ba5-4408-a5c2-08d4457b0cce X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BLUPR02MB034; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB034; 3:RE3X6zVBlc3WgPVz4gMXWQSAd3Aab6M4+Irbt6bRlhlPcn1uUP6GSn8pHRyR3p5+9F59tLVKDdoPxWLpqmplKmqE8JJegILdOjLIKu4XiVeSUH98XCwSZ+0Oa4taTiFOUBHeZg7IKsdbJawWnQldgDcziLz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IgFI83/J3n3K++jruvoag4TKLJ36SS4GFJK4XrKFMbQoLWWCrbwZvY8vXXY2abOcRVf3NMJi4ILWHkd0Ff4++MjMe91OxCF5IKnltVmJM8DUtz+yhJrxEInFudNcSVhQgqsVnvwf3LrIJfKLBP4BWRVNSuboucmAdQQOWi4NjfjO80en14cxyIwRQcZ4duyjAXW6wB0aAJWEV5Udv6EEWEYQCbeJHhzFjHLVDJQTuu24tjm4ewRpn1ss2hPbZ69AwsjD+ynjn2zNH1AKPcMfmkqPEP57Y229Q2xbp1RFqCI2qtOfSckZY+oMWcErJKrbvDuGs/jsrfcN/jybsDyvQsVZVC4JpPDMOrv/uneeCkPbsoAY4+8FXkNTcRy7zrbcgS8RvAIN+HJiUCQSYsxSnbli0HKWAjSpEquHpV46hsE01RFrSArrsJh4IVKHl4DJTdg3nKhtT9/M+Bnx3La8rdKzMbKMuOP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(20161123558021)(6072148); SRVR:BLUPR02MB034; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB034; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB034; 4:18ZHPGjJkHFFkl0qUA2SU+VgH/oef1gLB1bEGzGSC6t2U4p0ScDtEpz3f+76uRGo1x8s/cncL2tReG8QiKUu9zVnvG+qnFQRaUGdSyreYVaoi6YACwxX4SUyWIMqzVVC4auRxCwHxbVeKQ62a2fByJdCzMEnHoRAsg5Qj6afm9gtpN758AfPy8QNOw8vfrBLkJYQe5KRweF2/HZnh2W3pEi7uvYpqSOHCAro4SdhLQBelyLkhOMr7/R5rpd0KLwScMz8EyXFSzLk0XDu79d7YEjXvDgRXGmRqWf6eaexwL6auAH9j4X4YWUJsRZNVmumAISZEy7Nv1Wq2m94QLcazYVXBk6JDQWsvwvFJLPsCwAMIIDGXmYYaTsfLq1RfAcX1nngOQvP3SR9YZteyxaMriNY7V1iv8/4LNVhzJ2xL/Ear63da9n5ahrJVFvScFloohf6vC8Ozz+6XbTi+ufULm72UdvlrdxO4B9HbbZkNeOtDozcls5Twks0w3+X7ICZVxMlZhVL1VBY+TvOHXQU8OGzxJbEJQqNSJr/OZeMtrwwU5tPuoLQNm05FptaTdoM8kFJZzgNh4rwOoAQf+gRyVpTvvGNvj0O5uO4suzfWAvXYmMHz7Gwvsdkh53e0obG2UJOJLw7I9rQ05MKcDJ5nVjrQCIJSG7tgdlSnRmf1PswrYhRO7k6RHm7MUVxQIKcX3wak6WZ8fvjH6kvLrpS3w== X-Forefront-PRVS: 01986AE76B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR02MB034; 23:91uATEnxqjufgx5yU4svbyRF7VsHxgzfrIejPiye3t?= =?us-ascii?Q?xmvLoemQAOWSeEEIvJM5uEFt2njbukOjtfsi103YF4GB3TdlgdZOHycuG4E0?= =?us-ascii?Q?t5jU4JG0b2yWju5s31hdpAO3PjeMc3gY2y0HYMzfRr4j9J3ht4LxA07efexO?= =?us-ascii?Q?KTIC7lNA2ojBC/bUMvY2m7QJfopM3hA8EtTooYDC3rBF/oQl+jCnpWL/CL/x?= =?us-ascii?Q?A8Q+KG7Qahd1GLXLs2WRcgAimJOOKZjc6LXsMWGEX3Ae8bUeavpqiapIoFW8?= =?us-ascii?Q?jRbP7cn9fqH5gExcixliTofL6j5YvbursEMvWJD0F7VhBK21Q0mz0zui4qVs?= =?us-ascii?Q?Rpc/NlxerVpj414Jc3pzTe7N3MNOzCARGxeApnkOATHqCe5B6a+etQ9QQ+rL?= =?us-ascii?Q?KLRw9V9xMtg4F09gdGDU2NKGSgQRA7U8CcmoHW67dl0n/jlPs9PgXCWm1MGd?= =?us-ascii?Q?6LXsq0ry2laSPlbPF1geaVFe82ESRYoxTrRYgKPnncJis+XXRTxz9P/i482D?= =?us-ascii?Q?/664xBX7636pez8mTqn5CqhtyfIUegtd+v2cdhb31t3QUG4nlAD0izMy2yQA?= =?us-ascii?Q?WwzByfCBWCPaX7RC+ooGdwheKYDfC91W0BKGdhCNSu0vUk+rnwDT2hjAWVOZ?= =?us-ascii?Q?0Hg5jEpGbrnBbGpkm5gyoxnisyLyb2uClXT81DJfcoWcerpkB9HnEabyLPEi?= =?us-ascii?Q?drORzGGgKpYscJ4QVKAPr4J6Kb6o49A0zd/Ajp8KFJ2NM+Y2BepvSBH4f+IG?= =?us-ascii?Q?kLKXYs7uhkn28aN1N3b2e78NQO/5S61bs+rNuLhy4YLx0KhG3IfJEwfgnHUp?= =?us-ascii?Q?vikyA7YNygujp+EcmIAX6iQl371GeQaH6EEtDaOWsRx2L3K36tlETnOJ+8P/?= =?us-ascii?Q?Fyps2NnuEdDHrVu1PesFhHlnftajixX14/otRWTv2wznYixHsxpVHSz4nWz6?= =?us-ascii?Q?n/hWp4j3KvgAqK7pWMPcrNF5bB4eUW31DRQskiGI3fvgF1FRMNvfOxLruQ0L?= =?us-ascii?Q?ETjgcdPYv5gks9cHCuDLwPWH2WFZOk7Ng6tF6vOVbqWL53Ss6a4af+h4iN/y?= =?us-ascii?Q?u1KEm9yB3En0wYV7yJuGELz5w+GIEwLFpe6q7KvmVtTsRS5bTDN0p6XGAbcb?= =?us-ascii?Q?SpHvjtMNtJyYVffPb3nW+Ls4pgiRmXzdsH6l7HwR9TBi7CH72+gqDhDcCEIl?= =?us-ascii?Q?pGU/tWR6CgHTRiiMrLTsK/HYQBPf6+M2BvLF6CvQiRe/4LSV8SS29/GA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB034; 6:J0dYVr/XbAQQLmwcayxGbodweZvIvx0xWAVl9kQZrtj4/qaul2KFw3mtv/exVxS8wqOaukFgijE/+boChqlznaaEDjBG+hYeW3Pnh8TdGKZRpkZ5+5vvfUTftFv81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975wJ9T0DGPMApklQgzKQoGf3/39XQK0xYSIBks/yMpgjNSVb7hjP58YpJhiVHlQqXbnWOT350k7VnXqhA/r2LEd9REX0zeieQ== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2017 23:36:55.9720 (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.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR02MB034 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid that transport_cmd_check_stop_to_fabric() leaks a command reference if CMD_T_STOP has been set. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp Reviewed-by: Hannes Reinecke --- drivers/target/target_core_transport.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index f7b31cade25e..df23883869fb 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -614,13 +614,11 @@ static int transport_cmd_check_stop(struct se_cmd *cmd, bool remove_from_lists, pr_debug("%s:%d CMD_T_STOP for ITT: 0x%08llx\n", __func__, __LINE__, cmd->tag); - spin_unlock_irqrestore(&cmd->t_state_lock, flags); - complete_all(&cmd->t_transport_stop_comp); - return 1; + } else { + cmd->transport_state &= ~CMD_T_ACTIVE; } - cmd->transport_state &= ~CMD_T_ACTIVE; if (remove_from_lists) { /* * Some fabric modules like tcm_loop can release