From patchwork Tue May 23 23:48:42 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: 9744449 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 00F2E60380 for ; Tue, 23 May 2017 23:49:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E86C32885B for ; Tue, 23 May 2017 23:49:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCE8E2885E; Tue, 23 May 2017 23:49:38 +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 7351B28861 for ; Tue, 23 May 2017 23:49:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031121AbdEWXth (ORCPT ); Tue, 23 May 2017 19:49:37 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:63550 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935008AbdEWXtQ (ORCPT ); Tue, 23 May 2017 19:49:16 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="21079231" Received: from mail-cys01nam02lp0053.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([207.46.163.53]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 07:49:09 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=su3qz+WAx92Lvlb+uD6eH1SscOIqFScgkUjUJ9qk6HQ=; b=d9ZQ8342Pz++vId1jXyT+1nPN7k5lxZaCMDB8MNP0DW1m+7Ec+bZny1BMNf0Eo3tl74lVbs/Hw63zyWjoxDRkutwm9ZEyTh+X88JD1puGICk8pXBII5FCivK/1/hYpZalFnshfHdDmCrzfaFINRdKP4X95Anr8kL79dtTkb3fuM= Received: from CY1PR04CA0010.namprd04.prod.outlook.com (10.166.187.20) by BN6PR04MB0355.namprd04.prod.outlook.com (10.173.198.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Tue, 23 May 2017 23:49:07 +0000 Received: from BN3NAM04FT059.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::205) by CY1PR04CA0010.outlook.office365.com (2a01:111:e400:c5a5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Tue, 23 May 2017 23:49:06 +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 BN3NAM04FT059.mail.protection.outlook.com (10.152.93.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Tue, 23 May 2017 23:49:05 +0000 Received: from MILHUBIP04.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 AA.D1.45291.F6AC4295; Tue, 23 May 2017 16:49:03 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 23 May 2017 16:48:59 -0700 X-AuditID: 0ac94369-166ac9800001b0eb-03-5924ca6f7dfc Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 20.03.18148.A6AC4295; Tue, 23 May 2017 16:48:58 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Christoph Hellwig , Hannes Reinecke , David Disseldorp Subject: [PATCH 21/33] target/tcm_loop: Make TMF processing slightly faster Date: Tue, 23 May 2017 16:48:42 -0700 Message-ID: <20170523234854.21452-22-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170523234854.21452-1-bart.vanassche@sandisk.com> References: <20170523234854.21452-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsXCddJ5kW7+KZVIg+snDC2+/p/OYrHgzV42 i5WrjzJZtK0+w2jRuvQtkwOrx/3tR5g8dt9sYPNYv+Uqi8fm09UenzfJBbBGcdmkpOZklqUW 6dslcGX8uHyKreCNUMXlZVsZGxiP83cxcnJICJhIrHwzn6mLkYtDSGApk8TrmQ8YIZxtjBKr 3qxmhKm6t/A2G0RiI6PE9K9P2UASbAJGEt/ez2QBsUUEdCRm3X3BDlLELLCdUeLt5y6whLCA t8Sur6+YQGwWAVWJ5fN7WUFsXgEHiWmft7NDbJCXOLtlJzOIzQkUX7lnG5DNAbTNXuLyd2WQ mRIC01gl9p35wQTRKyhxcuYTsPnMAhISB1+8AOsVElCXOLlkPtMERqFZSMpmISlbwMi0ilEs NzOnODc9tcDQVK84MS8lszhbLzk/dxMjJNwzdzDefeJ9iFGAg1GJhzfBQSVSiDWxrLgy9xCj BAezkgjv8g1AId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rznZKZGCAmkJ5akZqemFqQWwWSZODil GhgZZyiIy9rLSXwvfD/lc+SZlQdPP13HbOgy+aZDt8pzg/cHjnszsgRXzH68TcBcNm55idiP f3L1CZrrsu3jb3FKqx7jmOxZLHo/eY3472tdL0UEtwstfTf/4EPjmvMvQztniuXXMPFfNAzc VsurPKMmq/ytrnDUdNe7ulNctOTdFA98Oblg8jIlluKMREMt5qLiRAB+rC1gcwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPJMWRmVeSWpSXmKPExsXCtZGTTTfrlEqkwYEfBhYHf7YxWnz9P53F YsGbvWwWK1cfZbJoW32G0aJ16VsmBzaP+9uPMHnsvtnA5jFtzXkmj/VbrrJ4bD5d7fF5k1wA WxSXTUpqTmZZapG+XQJXxo/Lp9gK3ghVXF62lbGB8Th/FyMnh4SAicS9hbfZuhi5OIQE1jNK PJm0gB0kwSZgJPHt/UwWEFtEQEdi1t0X7CBFzAI7GSXW/z3DCpIQFvCW2PX1FROIzSKgKrF8 fi9YnFfAQeJAzxcWiA3yEme37GQGsTmB4iv3bAOyOYC22Utc/q48gZF7ASPDKkax3Myc4tz0 zAJDI73ixLyUzOJsveT83E2MkCCJ2sF4faL5IUYmDk6pBsaVcQtEfyZf/SUi0m4Zrsrct2x9 x+4vcruPxybOLsgMZtyXwJY6640Uz47SX40L5V8tVlDWWb969fSHYl0sU1SF7xxb5yr6/DkD XzJf2LOSz50vHs+LeTTf7d6MvG826pNcA5il6i+cSu7ZPvFwuJ5OQlasip/79IT87jz9Y+/+ JL3NV7j2c4ESS3FGoqEWc1FxIgBvqwb2wgEAAA== 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:(10019020)(6009001)(39840400002)(39860400002)(39450400003)(39410400002)(39850400002)(39400400002)(2980300002)(438002)(199003)(189002)(9170700003)(305945005)(72206003)(33646002)(356003)(1076002)(106466001)(8936002)(86362001)(50466002)(50226002)(36756003)(48376002)(189998001)(76176999)(38730400002)(50986999)(110136004)(5660300001)(77096006)(4326008)(478600001)(47776003)(2906002)(6666003)(6916009)(5003940100001)(81166006)(2950100002)(53936002)(8676002)(54906002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR04MB0355; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT059; 1:1e5BH79MZIx1gv8IVuQ2d7GOPLVfI75J+FH7dCWjoy3Fgw/IxgtpXJqj39Uv0R/nd0ox3jBLI15dcHgyIsXvg2FLe+TOS3MFpltgwW5efjk7qqDobECZ1f79u43/6uAf81L6TRO9Bplf/JJegVQXCviVJH/Fkkkf54cZdxgWMLXDx/qhHMfwz2mgofTYmaCOR4ISekvlOkCRzdfHHmSsDBnbnsnVrIEsXzLHTO9qI1ePNIjYyQ9zpBEKzlL0YmY/ce9Fbv8h/hd/0h8OONnqKfRMI3DiU9AcDXeKL7gWQnkqNynWJFzUy3mpyIuawUVBLAtMpO0J7joG9WI7BZDTh4rTH1ANHbmA6pIkS61Mnil6O0TYDQmZA9sMhyN7H2mbKT+eVcmGft6zLFVgnL1Bnf5w/BPuDrPE/H/rUxO+r2lIh/dgKR59xq2QZZGs3E7zOe6A8fPhfzGBbACL0RBfXahR254UP+kKsITOYkgdpnuXaE9AvtIe8Z2LoXFenWAm0PWfjztMC923Dr7KXRNBvq/q6eh/mHLa2DeNsYMKcyE= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR04MB0355: X-MS-Office365-Filtering-Correlation-Id: 82ea7b8b-c60b-4bf6-8e3f-08d4a2364c9a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR04MB0355; X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0355; 3:ZHlVcJ4QUYd4Nw0PVYqSTaOwP/Ebf1JeRfel0w5SrK09VES6wroQq9slDW4koV7NiBtLLjGGIAjrbxwrESWrfm70+eoJ+mjDzeZBHH0uUdhWJrqjoyr/QOXHasmNVyhf2X8OzWaXKNrzAVwH1WIsB9d32fqvxePDHiR4nTGgA6Ap7ti/QmEVeY/QPxGx/kFxAS6wh28ALmSoVScQxO8TElMyjyjalWEc/4iGdb9ZiJ26Qcp1DnuBcDW8nFsDne/8pIjh5geGKfAUK3wB/8/tuGw87RuUKggIfUdCKEVQHOFC8zAcl+dg/8TcEDoBJ3a+tOKbnLK26/cDJWipVsMRokMz2hg1XD4ZHLivNBzJ4NTwSZtLw6TYy2dKPVgKoPTb/W+5a+114HolmHLHktiOqa7ucHVolEvRUHZd7uA7eggeNIpXvOP8CL0AkDaILapn8zxemfoubIjJagtgC1L1HFegerQh1DcBXPxcNEQsTXTT4eIJOafK8l1ryLT31AoL9crLb5oKOQ746NdIytlnew== X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0355; 25:3V4ki4YMJEa0v9/MJQ/ETzR2D4espw6/ktdA2DXqElKtDyyFtoY39y+8Ocj50dfUV2Vy2ZP9G/qJz1XmK/TN5vKisQIVEWHaBUzQ/5GnQemowbJbRc13UNWKCg42lGwW++O6bIENgJtRLL1R4eCxvesP5biosfbeWDZ74XXifvV72GatzrzERODfzKdQYOGpkUwzoL34pO19C68uYqMzXJO/29zxJM6vF3UyDTZJaygArNPuEHXwCnD201BX8xelZyni4z7r45FGQ9lD5j1wo+DAQv4AtFMtVpSD7r7vhodGbtBwXt/TmBhTbNzAUKq3y0wMCTVRrJ8D6+jYTQ9+qxUtXqsQlBkASGWfAYDwh0TO0GM4a3z3CHyGrmyuCLfypxCOP9ATiV5SkiXtEXKOulJIYSZA85og8MGFBWFCjk4wsVC16vYPnKmoPtjFrqIgJTlxqS6zqggBUPUma7ZW3xD0wB/DweVhoERab34XhYE=; 31:dU6Lqxa2NY6nuA/ocB9qi6Ic9NTNEv2vGWih365lAzht6tugDMeMTUWD5zZkc5eAI8KglQ6BCvEn91ycpMS8+DRML6Ndk2d+q+OVJuGnvATKFwFE3nh2WfwRBs7FYEPYmlQThMy7pfLxXZpgn/Q8Y3HswHHLijrrAPzQO+ZYgopED2GT9hWN2NJA3p0Qs+uv84ASpXgaPDqpJe9T90iehvbOjOwUp0YC+XCenAm0I3t0ZxRsqnd2c5LEXNybWvsH WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0355; 20:mJY1r68fOTohVWMTQb3hVofnilB2JcbivpPjOG0kfxz6n4GAcueg3pHt2bpS9DFkE2Qg9NVENdHqveKiEzB7mJgSMsrgVpDCgJGD01QCaExfqx8nCWLwsjQtsT/GppR4zcSn7W5eRhN2cRHHjrpD//WLwuKJPXrzcwzEheekENOTKn1Clk25oM0x+7qbPiDELVa29PSwsTH1nBphHbK25xRY07SO3ygOUQCgUyReb1REjVXdS7leCob4RTtNUq3yzy2A1RnvyGBBsz6ySKZBf44fkiWP7skhPPH2bpO+p+ERrQjQNANEkCwIda9UOc3Er0xECwT7dDDLy3KOiGBdTlnNHmuVAGYbC2dDvvWGiryTt/FJ1nbr0u3LufGfje3yU7Xj7SXRFbQYtfgkrxN9cp751MHxL4BoRuarH8Df+UTQ8VFAxRRcrvaNaKT6kVnX0a0xFRm+j2XhwZFQpabYz4dT9zSX5f8WEj0jHaydMD+wxOBnNrY9Kmy1IpTjxlIo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:BN6PR04MB0355; BCL:0; PCL:0; RULEID:; SRVR:BN6PR04MB0355; X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0355; 4:ZSLI159bi0/AQsQJA5/62viz2e5riPsUdUHACrbIB15E6rCmJyG6Y8O2ZQMubO3uklar7gtIHPSYNdiehB7GcDKHbSCpAGQY9q0kak9eN9eo6OrzmgpIzVAl1jss0k2QMF4CkOrTNbEY/17785+fnl2wkCnrCjPMUzzV1GyJIdlVhGzdmnm/s1C3i3ROHUgWdcpKmNb0zdiEJ6wC77E61GrX63fdB46MXOsr3EigGJhzGpok6iirAEv7IEoKnIoYQXw9ADP9HDVXMJHcIlD7dksIAl8+eZEiduklUENxbvh/khY8MjJIxlGq9eUr5JRz6eoQOmOngTCMGB7h6UvnA22FA2ZlqhKK0ykwoABAAdwOPEVDSy97VQmga9GKJSz71UIJEzeBpUeGHl1JiV2ZiLKIVKUy8SFmsJOS+Z7s8t/yNjWS3nl23oWMAoSlWa03TgxWCLXvm6/GfGFbx3bgb+hfHR4TxppCZ/CkLPAZQF5hn4c1UidjbbvUR/mym1QeSyn4Uclks5jKuQ5oklF6311HYrH/W67QEzAAS9EGG0PcI6FMmlILu5NDWR068IoOWP8lJvUfqhoO9cWhlgEnhGVmZiiACL+FfcNpv6hyO9XUxOqs7t/fGdgmVsXjfqGzmDe5DVTtqRhFApf/w51GgHO9JmSaYKv3Oy94Htei6fS4vMMpVO39MKJBpTIrVRykRBll4exx7mdkvsOFnKZNB9IKNiLSKLDEtJUhw3IzOsdXb7BXG3l4P5e75FQEFcEuatR4lDEQVAribtyEf0kz+o5q71ePWsG4in1sjI0KFqMUR7552XFHfM1VyZDVZ0qziY6eaZylsX9uQMT47C3ImdqbSmMoTzC1r+MpJBTxqGR0zhbu5gmgtpVfSuaZjIU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zOUaLmWFGTNnutpKR04fu8aSeEBcFlYmKV+eAoZFjGXVJ85VBS+DouwX8O4e2gpHAK4LRhCJAfdneQ==; 24:+Gapws9JeEGaRNAfsCPNzRtcSWj2DyYB2KsjeKFxmUQ1BJscE6AQvKEjJ2Y4NeR4oQX+WRw77L4eBJfJs04AqxhO/o2H/gIzkO/gppcBIYw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0355; 7:raJRrfEsfl/yZx8A8h4WYrjsNzstq/8Gt0BrS+X6JDUUAo+imY64LJwVdnRkPra8NcntaO8fj6va9ZAAAnt2yOxdg9tLdhwlxVC0a0Lebzq1V4pBj9N+s8UdCuHsQ3uYQPYBY5JVBjG4SGCqCbDzlVZPKEcMJ7CLQ7wqAwDDzBiBrTFqo1Bw3JFxqxeS0fSpscty2V2vqZFdG4zzw/js1CxSvsVI/MpJvA55QP7K4llU3kuSgI/0yXt5/sdvGfi9MQZtAsbdLAH2bU7ALtFhDUIpPmyMEpJZp66mHVOiFWJZz1txuFK5GxBzTKcpeBOZE3IRpaSh+I5Svg5iMIY9Eg==; 20:zayJujBfQfJ6vdceZOCXdEglVYeWHLoQgUhyXIXid1WJOBUNdvzzcSQgHBR6MudoFSDj66zZNTeu4hpCqHp//+/EgmjkBz5x6KEebLwE1gSIrvh2Wdp4Ni+qlkXYSuE5TPnWPVLLGcqSML3aY7xRPsdqx3aYpWd46vHbVpzpfss= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 23:49:05.8369 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR04MB0355 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 Target drivers must guarantee that struct se_cmd and struct se_tmr_req exist as long as target_tmr_work() is in progress. This is why the tcm_loop driver today passes 1 as second argument to transport_generic_free_cmd() from inside the TMF code. Instead of making the TMF code wait, make the TMF code obtain two references (SCF_ACK_KREF) and drop one reference from inside the .check_stop_free() callback. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: David Disseldorp --- drivers/target/loopback/tcm_loop.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 8cf556b4c5ca..b6a913e38b30 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -51,19 +51,7 @@ static int tcm_loop_queue_status(struct se_cmd *se_cmd); */ static int tcm_loop_check_stop_free(struct se_cmd *se_cmd) { - /* - * Do not release struct se_cmd's containing a valid TMR - * pointer. These will be released directly in tcm_loop_device_reset() - * with transport_generic_free_cmd(). - */ - if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) - return 0; - /* - * Release the struct se_cmd, which will make a callback to release - * struct tcm_loop_cmd * in tcm_loop_deallocate_core_cmd() - */ - transport_generic_free_cmd(se_cmd, 0); - return 1; + return transport_generic_free_cmd(se_cmd, 0); } static void tcm_loop_release_cmd(struct se_cmd *se_cmd) @@ -244,18 +232,23 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, se_sess = tl_tpg->tl_nexus->se_sess; rc = target_submit_tmr(se_cmd, se_sess, tl_cmd->tl_sense_buf, lun, - NULL, tmr, GFP_KERNEL, task, 0 /*flags*/); + NULL, tmr, GFP_KERNEL, task, + TARGET_SCF_ACK_KREF); if (rc < 0) goto release; wait_for_completion(&tl_cmd->tmr_done); ret = se_cmd->se_tmr_req->response; + target_put_sess_cmd(se_cmd); + +out: + return ret; release: if (se_cmd) - transport_generic_free_cmd(se_cmd, 1); + transport_generic_free_cmd(se_cmd, 0); else kmem_cache_free(tcm_loop_cmd_cache, tl_cmd); - return ret; + goto out; } static int tcm_loop_abort_task(struct scsi_cmnd *sc)