From patchwork Thu Feb 2 00:58:35 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: 9550917 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 87E7A60236 for ; Thu, 2 Feb 2017 00:59:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 732F52844A for ; Thu, 2 Feb 2017 00:59:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 683832845B; Thu, 2 Feb 2017 00:59:27 +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 CA30E2844A for ; Thu, 2 Feb 2017 00:59:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398AbdBBA70 (ORCPT ); Wed, 1 Feb 2017 19:59:26 -0500 Received: from mail-sn1nam02on0070.outbound.protection.outlook.com ([104.47.36.70]:49344 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751399AbdBBA7H (ORCPT ); Wed, 1 Feb 2017 19:59:07 -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=asiptHyjOIQwPWuM6JQpBCFfIOLVHnX6/t5FPzhOvDY=; b=CRsRBKDiwqEuXiF9msJ0KukBcHfKrK6Dj9Kdn7hGGixcrX4YL0FW5dndPp7T7ON2dnqbSW5yuFa3p1ch/hA9zHfhGPjniZWUJ/fx2e2j9kjIAx4DIxcXcs/0SX3Iil7paGkRttGfhcpgj7T7AverH4H1JpnZz/sIeUBI+VRC9/Q= Received: from BY1PR0201CA0017.namprd02.prod.outlook.com (10.160.191.155) by DM2PR02MB1290.namprd02.prod.outlook.com (10.161.142.154) 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:04 +0000 Received: from BL2FFO11FD008.protection.gbl (2a01:111:f400:7c09::140) by BY1PR0201CA0017.outlook.office365.com (2a01:111:e400:4814::27) 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; Thu, 2 Feb 2017 00:59:04 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) 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.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 BL2FFO11FD008.mail.protection.outlook.com (10.173.161.4) 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:03 +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 1B.7C.65426.27182985; Wed, 1 Feb 2017 16:46:42 -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-35-58928172857b Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id EF.63.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 18/36] target: Inline transport_cmd_check_stop() Date: Wed, 1 Feb 2017 16:58:35 -0800 Message-ID: <20170202005853.23456-19-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+NgFrrGLMWRmVeSWpSXmKPExsXCddJ5kW5R46QIg95ePYv9s54xWXz9P53F YuXqo0wWrUvfMjmweOy+2cDm8X7fVTaPzaerPT5vkgtgieKySUnNySxLLdK3S+DK+LLzLlPB G7WKA2vuMzUwdit0MXJySAiYSCzs/sjYxcjFISSwlEmiff10FghnK6NEy/k2dpiqBY8uskEk NjNKnJkwgwUkwSZgJPHt/UwwW0TAQOJ37wWwUcwCHYwS83uesYIkhAWcJR529gJ1c3CwCKhI fF2vCBLmFXCQmL9yIwvEAnmJXW0Xwco5geKLj0PMFBKwl/j25yjYRRICXawSJ9d8YYNoFpQ4 OfMJWBGzgITEwRcvmCEa1CVOLpnPNIFRaBaSsllIyhYwMq1iFMvNzCnOTU8tMDTVK07MS8ks ztZLzs/dxAgJ7cwdjHefeB9iFOBgVOLhFRCZFCHEmlhWXJl7iFGCg1lJhNcXGBlCvCmJlVWp RfnxRaU5qcWHGKU5WJTEeV+96o8QEkhPLEnNTk0tSC2CyTJxcEo1MPbsTvTO6Jif+SCUcROr /UPdu1dF6n+cqXlf4nDlFf/xhO0vFvcKue1n2Pgy5Y7eg5IzZbdFPmR2VHHz3WdXPSMmzCPy 96a4I5+RQf7E/wa5mVX6sxUOaPRM9NPpeHik18P5lQB3pWrv+46y/1uWXWeduVZmXwxnR4/t jEOifz5yXS65siNIUYmlOCPRUIu5qDgRAG4fxlhpAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZEjRTewZVKEweYfghb7Zz1jsjj4s43R 4uv/6SwWK1cfZbJoXfqWyYHVY/fNBjaP9/uusnlMW3OeyWPz6WqPz5vkAlijuGxSUnMyy1KL 9O0SuDK+7LzLVPBGreLAmvtMDYzdCl2MnBwSAiYSCx5dZOti5OIQEtjIKHFi1RVGkASbgJHE t/czWUBsEQEDid+9FxhBipgFuhglNp05xQ6SEBZwlnjY2QvUzcHBIqAqsXWyHEiYV8BBonft AyaIBfISu9ousoLYnEDxxcchZgoJ2Et8+3OUZQIj9wJGhlWMYrmZOcW56ZkFhoZ6xYl5KZnF 2XrJ+bmbGMEBwRm5g/HpRPNDjEwcnFINjFI6Cz6Xvz04caKFy2w+AzWho+6/GGvP35L5sOwZ R86Kym8yajNuBy7Y+VuR9Z/DxbrKn+FPniwvvL/si7Z8manCZ5/iCTwR50SWcatXhXj+/brY RP3NEt3fAmflXKNz3lzdzmbWmzxnkdH+43a/Pwg09PsmLfqd+Tp9pfnJCvebD3s231AV4FZi Kc5INNRiLipOBAAlSe0LuAEAAA== 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)(39850400002)(39860400002)(39840400002)(39450400003)(39410400002)(2980300002)(438002)(189002)(199003)(86362001)(1691005)(4326007)(33646002)(36756003)(8936002)(6862003)(50466002)(48376002)(77096006)(110136003)(1076002)(2906002)(575784001)(8676002)(356003)(5660300001)(189998001)(97736004)(305945005)(106466001)(47776003)(5003940100001)(81156014)(38730400001)(76176999)(81166006)(2950100002)(53936002)(54906002)(50986999)(2270400002)(7049001)(69596002)(6666003)(68736007)(626004)(92566002)(6200100001)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1290; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD008; 1:odh4KrbUaqRIbW1gUl9fUJlsE5J0+8YO56tUOvXxxkaE/7fwMLVVLcG3KUa93Pwz0xGKhYewl9CltvCFeotBZjEknyfxiF9TqEgX69PaLs0qP1W01t+uQWi+TNreTAfSTHmQECNVQ2HhTEGT+xToPYoUWKt806V18gJWtj21wYfLzefCUO2dsfqdCPEkFhCeOkkT0rX5MwyLvRDChLm0ikkEXtNjwP/0yNfhXyvRnbxLBQTZHZKYxwzqRLWLYZJ7Gk9r3qeEuzxfv/BKnF58tbZ3Bj/DE4wDEp6KLSFe67AbgFSBnLjFEbkUJCbsO6qwrRq6zolfUfa+Zpi1vxRQF0NHf2t9Vih0LD7MOoabOCyd+KdUnxzs78krnNDB1+OFfpS8foQNo4hDQCbCzw89URaNurnLVumW19Xdpe7e0Vle8t+GeZjb2HmN5szXnCa/o6ELrmklxYc59VMl7TWabAPAVQ0pNLrzEohw9DCYfU2ibTH6Eix+Wy+1iPkSQJ3x X-MS-Office365-Filtering-Correlation-Id: 553375a4-a117-4b7a-a241-08d44b06aeb4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:DM2PR02MB1290; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1290; 3:bUEbQ3ovtCxuekQMR3x/L3i2JxiYdhHa/c3bX21ioZimC3z9LT5oAqyz87Ej+fRsyoLTbY198EM6wJ5Lyz/kpP41Axxf+A0MrZ/+6BD6uvMYW9ya/zjK6UA1kMJcQGypm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20:MzgDWgAOh6yJyZA7L4HBncAFk5lqf5BKys3PoI4Qn1yXuUCA8laPaWtRbfeZRqjYNzV+Cn3nY5uAMj6QPbAGJ+24ZVocsg9C+0zGeeKl0e8S5j+TPWqi97gK1Sdx1azEmc2oYL83TbETyfzTfdi3gsEuTKcq03IYDG43yravsrHFuxmDwVv7VPZGoh6zhEIgSt1FCpeA72rlwYo+RTwFza3Q5qbz6GDgZhAWiK+thQShdY/oatg85hZ65VMw65e4bAgXxc/C4Cb6954Gnksh63qfk/L9XthezBFThbBOfSXAYDb03dYAnmQan2ZSTva/2tuYQ1GHjQzySzy0BgGv+GDm6yFT6e9cU/0gwaInmNrjWkbjXKniAP9b8RdBfXYvt/+eJ3rceswzTJjuLvP7gnIb6+xndKESFlLNv7kOodXWXRuAHDRhDl4JkaHRcS6AkHS6FizuEEMjooUFsr7/xwGErDUHmaYpgGxuiHzDaE5JDKc+MrU0/uNxN+ctAR2L X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123558025)(20161123564025)(20161123560025)(20161123562025)(6072148); SRVR:DM2PR02MB1290; BCL:0; PCL:0; RULEID:; SRVR:DM2PR02MB1290; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1290; 4:m42ajSmFN4FijSiP4jv6URciKk46zNQiOuWDOsoAw8VX/1OSB35PCqJ1psqZ5hfkP0ASs1UglGfW2lVpmxpcSrdKUwaz6xJJr1lt2Blr4kfxhrBJeShcBr4ghQjhNz+GKZMt0kUFSDFAc9UcJX0UUYwKMgCGk5ziaFiHZh/Eqg7mBy4Fqx8aYQ+NbELYIhUwZaPCE774zXZl/D1NJHLTZtok5nLEN0x1lsBlyt072Er2ni+xfKPS7N8Zls78ZtTcRscXVQXGPmxG3+hXDdwVYptskcmm8CFY64qYLCpFv6RmdK4DZKG8C5M/KFu79sW0+TldwyZELKfEhAWJIp+GON5DSniHzbW5kTW8tNTHmhTpDrwdpIsgf6DO77W9jWDwVwg4ttnja1c5jAJbWHE0PTyfWZnJVMIIqzPdBb5Hz/bVPqH+eR4C01zKWYsmI4szdWbJgTsbxk+kWujff7vOenFslOP9mm0GQwY+sp3AM9wIL6lEk/NW3bt64HxE0HjyAASehkfof7n+32H6MEDT6CQD0uZ0esdIaQn2/goZoA+yUizZ0V1euu05bSjBU5IDjBL1FrgpZdgMYHtdRBP7DV4SIb2QJzbjWP9gjScMMdvLfERjNEDraHd++O/dbrB4KBkRaF5/OWEIE4Zp/LFTqGccll35jyVJgMpqMv7BDYEmfCrn6E0XAcz80pW5pgwl1L0FU/C31G8kR8HZ8i00WoaNPnUSNOsXwjsDplufNG9H5zb3oeuy3LDDSCNKErrA X-Forefront-PRVS: 02065A9E77 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR02MB1290; 23:9zU03VjObWFKX+xmXoA5kjehDLlKLdX9EScqfM2e5?= =?us-ascii?Q?wBiS0aTNtagIjnrsWZawVSq3z1K5q5tpho83vpjv6CayhXchrdu+O6ppZsov?= =?us-ascii?Q?YHkN3Npk53ho8D0YMzm08dgg4IkrY9hi2kvCC6o/l3vEY7EahviP4E9JNvdL?= =?us-ascii?Q?IRho4PC9z8Xm4wc0e1fXb11h8rvb80GljelKRib8L4wvdwstMngoOFmnLkV+?= =?us-ascii?Q?PCBXRjtmHvMet19qY+a/6XkG+Mxbi4bxZCtOSgczUtCgNGjWFJuXlS/wQAVk?= =?us-ascii?Q?YbJstvo0RWXXzKFOZ4mDOUiqYS+ft0He9PyEpTNft559PRQPRWr6IQ4UGJ6X?= =?us-ascii?Q?ZV6etMmqAv5W7eIpaCKlDBo1tP08apPJEN9HfNdrMkciZot64BKxEnq0JMyT?= =?us-ascii?Q?l3sdrrkQBP+HaqAyA+8CsTnhdDVQgtuU99BtwznS4XKc3UjbL9fjd+vIJnOG?= =?us-ascii?Q?c+EorNsu8qOWzV3TF5+goU9T+PQhV2acGysgUhdkb41rvdvBu+3Pm9owYW0p?= =?us-ascii?Q?e66Jl9nzcrlns06LkqnEZlohSgQdMyclS8bgdrEZ8zAOfEa8xBJtB2K1xG42?= =?us-ascii?Q?ZyEvUl7JEakAE+h3vQf7TvFP1FBlOve3CVplnWK4eFKqldsTv2XpQhT165z9?= =?us-ascii?Q?m6xzVuUyP5DMlQVQIhpB33CQroqfsAxtHyK9l0XcA5mVOHWmrXS3p2rIRQMN?= =?us-ascii?Q?3kDv2v46aFek8HWBBrrFRSwERGbwls8ZK1Tr3RdLMs7lp43y9YkIpRR7e5Ij?= =?us-ascii?Q?0gPfLy9cYN4esVSA4qk5NlkN2POuJwhocMmJO8GGs37JRUQvd0CBcNP+wHQw?= =?us-ascii?Q?uawxYV8ueLkvSK5jq2K3rToq/OBKs5YmVyYxasbesiXJNvxB2vYjkmjoT2SC?= =?us-ascii?Q?jFGuj81BgXVJo7iJphmFEP4Kbr69Cz0WPOkmwwM/6qQc1G0/TrPvVzoP1THu?= =?us-ascii?Q?snaWwId9c2f+UI3BhXhsSU4tJZGkzuI2zqjYqhOGecypKZw9LNNFpqPwEhcT?= =?us-ascii?Q?+eq4kLehn6WrebXZlN4mjcEAtAx1dXbro/LAH6XV4IZVRd8WwQ/gtEfVU3sw?= =?us-ascii?Q?bq8mOTUBIipea6Z1rfRJRahUG1QlkFC28ArUxXc1t7cDijAlJBro1Gp8ZA7k?= =?us-ascii?Q?tgyMH/V0v3tkT897Nw4sRUhPTfoj8qHJiuncS6JrHA0619erQDR03Xj5+52B?= =?us-ascii?Q?pvVFSG0n7It+xujEoPIHnnwTngudUmUudsIgh3P83IyhqbliCvehNPOwpDul?= =?us-ascii?Q?a1pNQgYrunyvh/UT3U=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1290; 6:CwYOP4ZD5VBDNiQtHGL4HX5DK7Lqp66la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wL1ZMbTEE2kMgXcYoighgG/foSAjoxZZHK6pChwjDJueS8AfME8W4v9vhpBT2G5GJmZ3SHDyxc3xXvMtH4bSg7GlvaMRzTwOxE4M1Tt/9imffZAMqaBCvmiJi7arq0/e1RcVOu1QgfDZKW1E3f1jY6q2gT6vnvDpRrTXVGfnuWKQ/L/CL3PTPgfjV6cVJiRqdZgRB+1zJcvc8Fc+29yFvNnbuT9xnJIWj9fGDorkXSw== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 00:59:03.4519 (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: DM2PR02MB1290 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 The function transport_cmd_check_stop() has two callers. These callers invoke this function as follows: * transport_cmd_check_stop(cmd, true, false) * transport_cmd_check_stop(cmd, false, true) Hence inline this function into its callers. This patch does not change any functionality but improves source code readability. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Bryant G. Ly Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/target_core_transport.c | 68 +++++++++++++++++----------------- include/target/target_core_fabric.h | 2 +- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 25bc214a4eee..40dff4799984 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -602,24 +602,18 @@ static void target_remove_from_state_list(struct se_cmd *cmd) spin_unlock_irqrestore(&dev->execute_task_lock, flags); } -static int transport_cmd_check_stop(struct se_cmd *cmd, bool remove_from_lists, - bool write_pending) +static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) { unsigned long flags; - if (remove_from_lists) { - target_remove_from_state_list(cmd); + target_remove_from_state_list(cmd); - /* - * Clear struct se_cmd->se_lun before the handoff to FE. - */ - cmd->se_lun = NULL; - } + /* + * Clear struct se_cmd->se_lun before the handoff to FE. + */ + cmd->se_lun = NULL; spin_lock_irqsave(&cmd->t_state_lock, flags); - if (write_pending) - cmd->t_state = TRANSPORT_WRITE_PENDING; - /* * Determine if frontend context caller is requesting the stopping of * this command for frontend exceptions. @@ -632,30 +626,17 @@ static int transport_cmd_check_stop(struct se_cmd *cmd, bool remove_from_lists, } else { cmd->transport_state &= ~CMD_T_ACTIVE; } - - if (remove_from_lists) { - /* - * Some fabric modules like tcm_loop can release - * their internally allocated I/O reference now and - * struct se_cmd now. - * - * Fabric modules are expected to return '1' here if the - * se_cmd being passed is released at this point, - * or zero if not being released. - */ - if (cmd->se_tfo->check_stop_free != NULL) { - spin_unlock_irqrestore(&cmd->t_state_lock, flags); - return cmd->se_tfo->check_stop_free(cmd); - } - } - spin_unlock_irqrestore(&cmd->t_state_lock, flags); - return 0; -} -static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) -{ - return transport_cmd_check_stop(cmd, true, false); + /* + * Some fabric modules like tcm_loop can release their internally + * allocated I/O reference and struct se_cmd now. + * + * Fabric modules are expected to return '1' here if the se_cmd being + * passed is released at this point, or zero if not being released. + */ + return cmd->se_tfo->check_stop_free ? cmd->se_tfo->check_stop_free(cmd) + : 0; } static void transport_lun_remove_cmd(struct se_cmd *cmd) @@ -2389,6 +2370,7 @@ EXPORT_SYMBOL(target_alloc_sgl); sense_reason_t transport_generic_new_cmd(struct se_cmd *cmd) { + unsigned long flags; int ret = 0; bool zero_flag = !(cmd->se_cmd_flags & SCF_SCSI_DATA_CDB); @@ -2454,8 +2436,24 @@ transport_generic_new_cmd(struct se_cmd *cmd) target_execute_cmd(cmd); return 0; } - if (transport_cmd_check_stop(cmd, false, true)) + + spin_lock_irqsave(&cmd->t_state_lock, flags); + cmd->t_state = TRANSPORT_WRITE_PENDING; + /* + * Determine if frontend context caller is requesting the stopping of + * this command for frontend exceptions. + */ + if (cmd->transport_state & CMD_T_STOP) { + 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 0; + } + cmd->transport_state &= ~CMD_T_ACTIVE; + spin_unlock_irqrestore(&cmd->t_state_lock, flags); ret = cmd->se_tfo->write_pending(cmd); if (ret == -EAGAIN || ret == -ENOMEM) diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 358041bad1da..d7dd1427fe0d 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -47,7 +47,7 @@ struct target_core_fabric_ops { u32 (*tpg_get_inst_index)(struct se_portal_group *); /* * Optional to release struct se_cmd and fabric dependent allocated - * I/O descriptor in transport_cmd_check_stop(). + * I/O descriptor after command execution has finished. * * Returning 1 will signal a descriptor has been released. * Returning 0 will signal a descriptor has not been released.