From patchwork Thu Feb 2 00:58:50 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: 9550935 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 957B960236 for ; Thu, 2 Feb 2017 00:59:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 805942844A for ; Thu, 2 Feb 2017 00:59:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 757702845B; Thu, 2 Feb 2017 00:59:36 +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 DFBEE2844A for ; Thu, 2 Feb 2017 00:59:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751308AbdBBA7f (ORCPT ); Wed, 1 Feb 2017 19:59:35 -0500 Received: from mail-cys01nam02on0059.outbound.protection.outlook.com ([104.47.37.59]:47605 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751415AbdBBA7S (ORCPT ); Wed, 1 Feb 2017 19:59:18 -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=nrWq/xuHa/9UDDVkFqy/pLulvCETt0m5DCnN8wAyKcY=; b=dTCeXJTmE/0dRGIE1ABCJLv/ZH8TxAA3QwKmTS5cNA0HQJivO/kXlewpB5wP9eFKYy2sZuYWuPMC2L9giSBzRdFXDMCV3yrbR5V99VRbNnrg035CSDyG2XJEssHi84yJ9uq8GyA148JZaaLtVf5Ygjl2Lxgx23T8C7hQ0UfMziM= Received: from CY4PR02CA0042.namprd02.prod.outlook.com (10.175.57.156) by BY2PR02MB1409.namprd02.prod.outlook.com (10.162.80.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Thu, 2 Feb 2017 00:59:05 +0000 Received: from BL2FFO11FD018.protection.gbl (2a01:111:f400:7c09::125) by CY4PR02CA0042.outlook.office365.com (2603:10b6:903:117::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Thu, 2 Feb 2017 00:59:05 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; 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 BL2FFO11FD018.mail.protection.outlook.com (10.173.161.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.2 via Frontend Transport; Thu, 2 Feb 2017 00:59:04 +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 7D.7C.65426.47182985; Wed, 1 Feb 2017 16:46:44 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 1 Feb 2017 16:58:57 -0800 X-AuditID: 0ac94369-b62949800001ff92-3c-589281748d7f Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 15.73.16817.15482985; Wed, 1 Feb 2017 16:58:57 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , "Andy Grover" , David Disseldorp Subject: [PATCH v2 33/36] target: Inline transport_lun_remove_cmd() Date: Wed, 1 Feb 2017 16:58:50 -0800 Message-ID: <20170202005853.23456-34-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202005853.23456-1-bart.vanassche@sandisk.com> References: <20170202005853.23456-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsXCddJ5kW5J46QIg0kLhSz2z3rGZPH1/3QW i5WrjzJZtC59y+TA4rH7ZgObx/t9V9k8Np+u9vi8SS6AJYrLJiU1J7MstUjfLoEr4/+TScwF PxUq1i21bWBcJ93FyMkhIWAiMXHnLuYuRi4OIYGlTBJ7n9xng3C2Mkq0nG9jh6laP/cxI0Ri M6PEmedzWUESbAJGEt/ez2QBsUUEDCR+914AK2IW6GCUmN/zDKxIWMBZYsWVJiYQm0VARWJC 0z5GEJtXwEFi/bvHzBAb5CV2tV0Eq+cEii8+DjFUSMBe4tufoywgQyUE2lglfu25wwrRLChx cuYTsCJmAQmJgy9eMEM0qEucXDKfaQKj0CwkZbOQlC1gZFrFKJabmVOcm55aYGiqV5yYl5JZ nK2XnJ+7iRES2pk7GO8+8T7EKMDBqMTDKyAyKUKINbGsuDL3EKMEB7OSCK8vMDKEeFMSK6tS i/Lji0pzUosPMUpzsCiJ87561R8hJJCeWJKanZpakFoEk2Xi4JRqYJyT1yq6/ljJ8fVFaXJS H0St9R79r/nyoX9F1Grjts/TuN8v+psddPqS10ybiM7GrbvZCs2t1LosZ/NsKnNtqH/p/XvX j0062Ud3rXKdwv10/YED+6bo13+fb3loXmNodv8CDdNvHlX+Dnr8Ub3V0wtj5G8FPz99dese HtHj9hl9QjyqTm+lvJRYijMSDbWYi4oTAVz69FRpAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCJMWRmVeSWpSXmKPExsXCtZEjRTewZVKEwevtahb7Zz1jsjj4s43R 4uv/6SwWK1cfZbJoXfqWyYHVY/fNBjaP9/uusnlMW3OeyWPz6WqPz5vkAlijuGxSUnMyy1KL 9O0SuDL+P5nEXPBToWLdUtsGxnXSXYycHBICJhLr5z5m7GLk4hAS2MgosWXPdHaQBJuAkcS3 9zNZQGwRAQOJ370XwIqYBboYJTadOQVWJCzgLLHiShNTFyMHB4uAqsS9Dh+QMK+Ag8TTuzvY IRbIS+xqu8gKYnMCxRcfh5gpJGAv8e3PUZYJjNwLGBlWMYrlZuYU56ZnFhga6hUn5qVkFmfr JefnbmIEhwNn5A7GpxPNDzEycXBKNTCayt1ZG5vx/ZZriu6FR2XGC4O/6T14vaXVa1e4Yecr 1RJ/iQ9TW/g+bbf41Rmv1Kt6yqG+/aPk7VjBOy7z3vucKN/2fZ7B5mXN9jfOBW0uM0+fbpvP rSt/c/7c6BnLP8Y03rp/JuUXQ7nyumPrxNwUXFhv+W5vtKyze7JP+xPv5O/tqT93PfukxFKc kWioxVxUnAgA3O7IEbcBAAA= 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)(39450400003)(39410400002)(39840400002)(39850400002)(39860400002)(2980300002)(438002)(189002)(199003)(2906002)(4326007)(50226002)(50986999)(76176999)(356003)(2950100002)(1691005)(106466001)(81156014)(81166006)(305945005)(8936002)(86362001)(6666003)(38730400001)(36756003)(8676002)(6862003)(47776003)(1076002)(33646002)(69596002)(92566002)(97736004)(110136003)(2270400002)(48376002)(68736007)(189998001)(50466002)(5660300001)(5003940100001)(54906002)(7049001)(77096006)(53936002)(626004)(6200100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1409; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD018; 1:aHOYzc2+F87FyjoFvGyi54/aRYrmOCwJ0igK9fFoxbOwa4N0YAHAaZMdSQPP6bwIt5A15O1CvhNKxumj3/JpEgagqjsvgwDOcOgAYhxq6BZVpGd996jcBvt4M4nBL7Ydvqo3HqoYDLaP+MNpNfsWdcEcR96zrbUQv/7s4E8pkK0OwsVUUqIYuK9jrT3nt2EJDMr9lgVvJzVpHwt07tVUcCD9fEA5mxZ8F3pMGvlZ9Q9jkZQbCoJ+6BAzAubHIurvXIrVA+xqedrfF6WOObC/o485f+V6scDzhlH+8avStUPJMVs6hQcMFZmzO4jKRei+AKmv83aTLY+jx3y9HjCEy/S9cUMvD86Chr85/TDHLgII81mU6sDcGbAk4pXxefd4BEEuhozgqHT+NVJo9tTeDpLD4VFqc392fvsG29nNClDEDy5UvLPIMqSvrfS7uk3oeWyA/crvANAwKseCPnLZ5ha8j8MxH/zCO0oGA6oBM+i45T6fgGQ6SotvP0S1VuDx X-MS-Office365-Filtering-Correlation-Id: 27c5eafb-8414-401b-e505-08d44b06af49 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BY2PR02MB1409; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1409; 3:AWOx/HtMh7JjnL9sixjkmvjme1eyS7E42KDIyygY2l9nZRbUt3DeO1HGkDFiWaSWAc+F8moSEikM60X8aAf7dE31Fb6nTQYhh+VzJVDlgvyI9iHFBeiHV4obCrbmKlf1rhNAS0QY491+J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diagnostics: 1; BY2PR02MB1409; 31:s0urDlBp5oQMyYQfXBB+hY/dUuZAk2qpGrVqjUaXg5Mr0CknSzHxtBBdZT/Lp6cHT7eZlbsd7WUdyOVntzSTRYPmVmvo8VXAkxooVHdSIVSp7pt3HQFlToGeZA1n4LVQfg8cBisy3ciy8k5vR7aM+ohwNDxCpQWnnMwcueBxGhJz3bWNTjObBQ++ucLI5VLkx64C5XCKIFxYiJK4avaQt+tPX3gb3Sr6LIrHfDu2WVx1PVfx6UMm3/eD/aJvIIlVkU4tKUAqX5JS2SlnAYF+dQ==; 20:guiUHs+YqeITE9almuCJCDeuue6Lq+f71U4CP5CgxJ1qO3O3pGkKHCzEEMZnW3Qh3x7rPgRjGr2XeJqi2RRAZv3PZ80bAAL2hnvqPegHE9hMEcpKNEFYt3nlTDID6bkFzMXm/wONo71qIW+7dqaUiFH4A3xkoiCHo9NsL/ot54eGtU9UoHPJMeeqRy7a2SXe3ORABhIZX2Yi4ZPWa7uJ9gR+ZqhbLiflWrBvrXOfvQVdznf2JigbpOylu7RvfyrJ0Tc8WmOH3WwONq+kzyoyLA8FGkk6NbUMvSmdLdvPcEmXFVrs+z02qRTjD8MFM1K5V25pgRmd2R7Uf2LPTS8Pq+sDye+1muOEzlDRqmM2QZTd0KG/1Uky5HhFOPI08kZtYoL92oCUwlr7KKRDKoUeK/jJyWIgV/ddkD/e8aYlmViYvTCMWd9vzvn/Q0LGzxspdCSRwVWqxCUqpWXVjiYKEE/l8kYpY8PJ6m9Xm1Aid7MIh+PvY+Vw0Y8jFqHnpuT0 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)(13018025)(13016025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(20161123558025)(6072148); SRVR:BY2PR02MB1409; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB1409; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1409; 4:ahKJIKLogZIYSbBqnXgTBohvdmA3PbK/DfUR7SwhiW9gFIxN0BQU7v3l49xspRlVRJ/ZuoX7aaih92ELYuNIfIr942OI2EpctT4jp8+T39TusuVBW5obLonidBPjbly6k4sm9j3Z8zumqbSWkkec7O0b/o256YTJ+KZyLQKdSp+8rIgVBWF/sV7tFLKwPu/KliKoKWaTzNzdxuu5iwrwXuR68K0+kxL6gDY6ZO1GBGJtieWdUwLDL/XvZDhnd9AO027Qnx9pSV7Dbj2UNaIiMerrOFjCXssKQn06uD1BItOQDBuP55o6NGxRiHIOz5AA2YvG7iuufNHo12sqV6KresM5dtiDEMHA3q78crYWyPxDdTfsDhke82VfF+qYWJ6cQeV2aQNtq02jmOcKSR8vofpCD+lPWVA1gi85POlNNaowQ5lg5vbJ8N4SOiJrqPy3ht810phaLnE4Di9tvHqH2NBkOIfuDsamo3Wvw5rjrJS5LpFrc9p0uFDZR3whs6B7vr4JZOJPtwOO/em+2vp6A8ca7SElW/dZQGCh3lVb5VGh3gZW/rwiHanJuxUbfNwAEDz/62zgRu6nipFYK46l4hi0eDb0sr5SrC95nlGIjFrm0yZhNxnn/VafcfSE6kw7aPZbSpzG9snVSDzt9E+s/ljqv6FhvHO1bWXpNPXeefwnbsHHi3Kt6q7gACbPgeMKOxx65tWv2yFaONAyC2tl7w== X-Forefront-PRVS: 02065A9E77 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR02MB1409; 23:Ci2GE0N8PUFht60hJKQvl5Zm9ofk6fJ3mtfP0oZMK?= =?us-ascii?Q?wee1qV8IL6bXkX0k5AG643wpSUo6OunxOi5qul5lrEAc2Tdh9ynA2GyNg3fX?= =?us-ascii?Q?y2zibkERvq5FyBO110pLxoCRcAhX1fIy/GTLKLBwHxvROiH8nEnugy2OYKuH?= =?us-ascii?Q?oUShjEf4jpznD2bs4jBJG04S9Dk+ME3BQHase1Abd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XK0O7CDtVyuJ3IRBBQHsrhBwzvTiVEq6iO0HsRHPoPBTzn?= =?us-ascii?Q?lKNRejPcz7rQYmN2Tw85XBPVtzcnNgtmRwmKHx4tcsbb/7OTzkK++ucINQEf?= =?us-ascii?Q?MTlWP4+/OQ17f95v+hkChG0vkCkhrfcGA0B9v05U2hHOiVbd+yJ+t3GQw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1409; 6:vAx9I0bu09PslUWWKLI0qSpzNWiDk5jXMTtmmVkcxkaYgUW0U+TKR3xlzJc5fCrTkSB+cePE994eALhJNPoDCwEz/rSluCj6P9LuxssZ5GWqvMDrZsLEh2vAxSJwPUIslC/9D35QcWNIqwMiKralcgfzspsM69Txr0rKFepeqp7Aie/YGIIdGXefmAT91t3kicbZMxy7nsxrz1U40OSqXEzPeqbvPDbBQiaz1pbbBgl1KceUE15tmcdxWY9O+xXw1UDtInMHLKxFAebUmXp018KKU9/B3K/rrkYmuJGbpIUCnr5Y1vlwRTArtUZCPXLw9YH/NEhV5SygytZqB0m+V8Xz37+174GI8C+kAoDFj0YGTSJpjpID2fpeoYC315IDUJm7l5j8qm+sIrsmHrduacgOwkUXMMI+u3vemtoLdU9UiTFwpijl99sk6THq/nFa; 5:nzFCpDqkTqS595cYMk22sD6cGxreOiRTR/gA83Btha0oXfDIiQkdU4ZWV0ULX7IjbLMjIrCH/8Sb/8v6agaXHzw0/UGuPV25NQr/b+wTlX9WYiX67g7mAp4krbep48MHE3T+mn9PJ/Q/oB129e4tUHJgVxCeTFB/2TlJJvwSmPs=; 24:ZMtKs9mP80iMx0WKF2nFPR5rMZZZ1Sq5UDvKB9Y1GjONXvJ72FZFDfjfaHZylWVwhyiTVkXN9l5UfA1WhvJH7aTbXR9eEiJC6fVkXJwIcbE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1409; 7:yleT1lraG/5M+aoIyGVN0lW9E/KopOpQSp0cPloIBethaA//5zcQ6JMAP8ePWX1Gk7xFjphkt5FTV6G9V3fiEANiLM+8gh0lhYjgaiwbxvm2x92SKDh7WiVM7wRUQLGTsLiHZDnTOeSRlKQZUXrrV+Sn2XgOvWBmyXBRdiUz/v9Xhxv+aEI5i1Dcuk7qOh4SUIdOkHG05ywcyHs5ueOO95QPru7GldHjbxR8H4rcexhJDihtz0/4THPW9xHRM/y/1Hbv1OfgDHJxr4fag13VSYYhofjL2JIwGQZEcXYZQkkzOYuIvnoh/TAvrVzceODRe8cInIimG+3V3dNmZst3fPmWii8Sy512U4k0piu45RsZZLSlH+aI/dNt1MZWWSe8Zi/MLqMLCKh8wsAJDEF66pBzG7fDAPZojeoZ52BlnC22xCznNKITjNtVH8QwlcrtK8govj0kzwA/wjNzwZv5dcyv5YjCPwd+TNSElzwt/yRRl4R6jTno9M2Ic59OsrAzkJhXMI2q6aYA2Kc/JwJvt3Md8+ZT+mFfBFj9BTtyx2lKIU/ytUtafLPwvXjvj4D/ X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 00:59:04.4457 (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: BY2PR02MB1409 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 Remove the code that clears .se_lun from transport_cmd_check_stop_to_fabric() such that the transport_lun_remove_cmd() call can be moved into target_release_cmd_kref(). Because this guarantees that transport_lun_remove_cmd() will be called exactly once, it is safe to change the cmpxchg() call into a test of se_cmd.lun_ref_active. Inline transport_lun_remove_cmd() because it is not worth to keep it as a separate function. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/target_core_transport.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index b10c8dc995fb..59d27ec8a872 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -604,11 +604,6 @@ static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) target_remove_from_state_list(cmd); - /* - * Clear struct se_cmd->se_lun before the handoff to FE. - */ - cmd->se_lun = NULL; - spin_lock_irqsave(&cmd->t_state_lock, flags); /* * Determine if frontend context caller is requesting the stopping of @@ -635,17 +630,6 @@ static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) : 0; } -static void transport_lun_remove_cmd(struct se_cmd *cmd) -{ - struct se_lun *lun = cmd->se_lun; - - if (!lun) - return; - - if (cmpxchg(&cmd->lun_ref_active, true, false)) - percpu_ref_put(&lun->lun_ref); -} - static void target_complete_failure_work(struct work_struct *work) { struct se_cmd *cmd = container_of(work, struct se_cmd, work); @@ -681,8 +665,6 @@ static void transport_handle_abort(struct se_cmd *cmd) { bool ack_kref = cmd->se_cmd_flags & SCF_ACK_KREF; - transport_lun_remove_cmd(cmd); - if (cmd->send_abort_response) { cmd->scsi_status = SAM_STAT_TASK_ABORTED; pr_debug("Setting SAM_STAT_TASK_ABORTED status for CDB: 0x%02x, ITT: 0x%08llx\n", @@ -1752,7 +1734,6 @@ void transport_generic_request_failure(struct se_cmd *cmd, goto queue_full; check_stop: - transport_lun_remove_cmd(cmd); transport_cmd_check_stop_to_fabric(cmd); return; @@ -2030,7 +2011,6 @@ static void transport_complete_qf(struct se_cmd *cmd) transport_handle_queue_full(cmd, cmd->se_dev); return; } - transport_lun_remove_cmd(cmd); transport_cmd_check_stop_to_fabric(cmd); } @@ -2104,7 +2084,6 @@ static void target_complete_ok_work(struct work_struct *work) if (ret == -EAGAIN || ret == -ENOMEM) goto queue_full; - transport_lun_remove_cmd(cmd); transport_cmd_check_stop_to_fabric(cmd); return; } @@ -2130,7 +2109,6 @@ static void target_complete_ok_work(struct work_struct *work) if (ret == -EAGAIN || ret == -ENOMEM) goto queue_full; - transport_lun_remove_cmd(cmd); transport_cmd_check_stop_to_fabric(cmd); return; } @@ -2155,7 +2133,6 @@ static void target_complete_ok_work(struct work_struct *work) if (ret == -EAGAIN || ret == -ENOMEM) goto queue_full; - transport_lun_remove_cmd(cmd); transport_cmd_check_stop_to_fabric(cmd); return; } @@ -2191,7 +2168,6 @@ static void target_complete_ok_work(struct work_struct *work) break; } - transport_lun_remove_cmd(cmd); transport_cmd_check_stop_to_fabric(cmd); return; @@ -2506,9 +2482,6 @@ int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) */ if (cmd->state_active) target_remove_from_state_list(cmd); - - if (cmd->se_lun) - transport_lun_remove_cmd(cmd); } BUG_ON(!cmd->se_tfo); return target_put_sess_cmd(cmd); @@ -2569,6 +2542,9 @@ static void target_release_cmd_kref(struct kref *kref) struct se_session *se_sess = se_cmd->se_sess; unsigned long flags; + if (se_cmd->lun_ref_active) + percpu_ref_put(&se_cmd->se_lun->lun_ref); + complete_all(&se_cmd->finished); spin_lock_irqsave(&se_sess->sess_cmd_lock, flags);