From patchwork Wed Jan 25 23:36:43 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: 9538145 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 91E316042C for ; Wed, 25 Jan 2017 23:37:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87EEA27F17 for ; Wed, 25 Jan 2017 23:37:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CDF227FBB; Wed, 25 Jan 2017 23:37:24 +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 DE1F227F17 for ; Wed, 25 Jan 2017 23:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752074AbdAYXhX (ORCPT ); Wed, 25 Jan 2017 18:37:23 -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 S1751344AbdAYXhJ (ORCPT ); Wed, 25 Jan 2017 18:37:09 -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=3OrFAN/AFaYyiXnE289QtyEp3O5vkPTjGKTT2qod+AI=; b=ZBtNIMMQA9mDf1ScsXXrcjL6ied3C/hgjyG50oFkc7X1plVPXqcmQJhNl0pxPcfcPjjbESoNO3Bk9KH4G6wiW/UyZDBb12PRG2WlpJR2Iy8IVld3C4dNmOpYpyW3nfPeemhdExl5qv+5wWc9PG45uL89mC5K00SJ65Zku1RIRM0= Received: from BLUPR02CA033.namprd02.prod.outlook.com (10.160.23.151) 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 BY2FFO11OLC007.protection.gbl (2a01:111:f400:7c0c::125) by BLUPR02CA033.outlook.office365.com (2a01:111:e400:8ad::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12 via Frontend Transport; Wed, 25 Jan 2017 23:36:57 +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 BY2FFO11OLC007.mail.protection.outlook.com (10.1.14.254) 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:56 +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 5D.C8.65426.7C339885; Wed, 25 Jan 2017 15:24:55 -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, 25 Jan 2017 15:36:50 -0800 X-AuditID: 0ac94369-b62949800001ff92-37-588933c7fe63 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id F0.45.16817.29639885; Wed, 25 Jan 2017 15:36:50 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , "Andy Grover" , David Disseldorp Subject: [PATCH 31/34] target: Inline transport_lun_remove_cmd() Date: Wed, 25 Jan 2017 15:36:43 -0800 Message-ID: <20170125233646.2243-32-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+NgFrrKLMWRmVeSWpSXmKPExsXCddJ5ke5x484Ig+/vpS32z3rGZPH1/3QW i5WrjzJZtC59y+TA4rH7ZgObx/t9V9k8Np+u9vi8SS6AJYrLJiU1J7MstUjfLoEr49zZDraC 0woVX969ZGtgbJXuYuTkkBAwkdh9cj8LiC0ksJRJ4kmfQxcjF5C9jVGi+8dU1i5GDrCidXNL IOIbGSXav79iBWlgEzCS+PZ+JliziICBxO/eC4wgRcwCHYwS83uegRUJCzhIfP71nA3EZhFQ lfg06TYjiM0rYC8xa98kFogr5CV2tV0Eq+cEiree/Ql1kZ3E+gOtTCBDJQS6WCUWvt8L1Swo cXLmE7AiZgEJiYMvXjBDNKhLnFwyn2kCo9AsJGWzkJQtYGRaxSiWm5lTnJueWmBoqlecmJeS WZytl5yfu4kREtiZOxjvPvE+xCjAwajEwyuwpSNCiDWxrLgy9xCjBAezkgjvOrnOCCHelMTK qtSi/Pii0pzU4kOM0hwsSuK8bve+hAkJpCeWpGanphakFsFkmTg4pRoYU7lmKJ5oW1q5LqTG uS7PbM1UrqC1vE/L/x1p/PDiXc6KWru6yxwn1jgpO6oLK112SDz/RNzs7OXjJg7HS28JiZ+x u7kp7o2WTe+8SxeKc87vZtVNnrWSKTHt776mi8e655/I4u/YGG24im+V4Jvle4qfeqwNODv7 a2j8PQ8pxfny6o3/JyQfU2Ipzkg01GIuKk4EAP+91ONoAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTXeSWWeEwZKjHBb7Zz1jsjj4s43R 4uv/6SwWK1cfZbJoXfqWyYHVY/fNBjaP9/uusnlMW3OeyWPz6WqPz5vkAlijuGxSUnMyy1KL 9O0SuDLOne1gKzitUPHl3Uu2BsZW6S5GDg4JAROJdXNLuhi5OIQE1jNKTFl+k6mLkZODTcBI 4tv7mSwgtoiAgcTv3guMIEXMAl2MEpvOnGIHSQgLOEh8/vWcDcRmEVCV+DTpNiOIzStgLzF1 2VuwGgkBeYldbRdZQWxOoHjr2Z9gQ4UE7CTWH2hlmsDIvYCRYRWjWG5mTnFuemaBoaFecWJe SmZxtl5yfu4mRkhARO5gfDrR/BAjEwenVAPjMkkD1n38Mtna0yJqb2RuF5x3cUPG8jvm3y3W 52mwP3S4oG7xSyKeJbdsU89C077NN1PlzbYccTh5QdzlXEjNYc0/sTznDap+FGvt33pGaO6F Cpc7etlePOc+RHWKu/BejHjh9vvSyaOO5RrnL0pveRf27yfTm1NqGYtbkmWrWfzXn6gS+TZB iaU4I9FQi7moOBEAQ7DRQbgBAAA= 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)(575784001)(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; BY2FFO11OLC007; 1:548qahdhizLNUfsCNBB0dIVhWS+zm/6J4hZ8rj9XUE8AR6C5MzE5DbuePO9d0W9iwStqHYh4lzvOoW/zWbDJRailSO79/Cukibau7Xv49kSzC+kFEqwMNyzRsV+TNSIYd4VOCLxGEtQjcQq2ilcoSRq+1Tx0R1faaj3XPlfpuAJHblLY6S+mM2WxkmZ8tdAwhVlV7RG4buXk+Xd1I7EPO0KGue7k0RlenqY3x/t7hX9WxWwP+z3J+nwOkUQjHgY/BC8luu515SOS78eV7F4d5gwixIyyElnOEAXAjCxVhekOojlV2JS0YCu7/vC3MyaY5+3OPATur9kigkO/a/N8U2KGZK0U8gq1WUEyRtxX3de4CqBOTj02MVP5xO454l97YpHX9d2xq/c43E3ytD85JegK8zOr0IoyS0KQ1EZ5CjFhwUJThpdYTHhIDzvoxIQyHVMfBQWizXfT3X2CYAciBBptJ5+FkmXrq4exSjNATnQHMMx+Ol87eIKmMNg8eKIR X-MS-Office365-Filtering-Correlation-Id: e29236d9-4c18-482c-146d-08d4457b0cf4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BLUPR02MB034; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB034; 3:xGXmP1gjFLOi1YBOLyLng6patU0Rl2qIUjDGoEre8NSTEAZodRoKIY6O6E3NyDO9Qi95+NErhyZq6RIUuKhFaIqQFvUG2QDIs5JjqTYC55mjmdkdq3Bw9SSmkbgdg5HST3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sWHcifw2P//no=; 20:tGB8god05vEVrkPzcmbznwBO/N5P7HLfAAFvSftqrf6hxMoQivecYIEmClfQ4OAXEF8jQYBcuFhRrYre/Tgwjfu0tFkjPNMulIinZsdHz/Q+9yGzC7RN3JzxWyLvJ+cUFYYeSB9KWcVRg9kb66kxn3D2VFabZSPhzD9s7XvqNq02TPlPEKB7l9yuZ4mJBqQjRPaynKRGivFohJbnNURlTTv63qQkgtH7CSl0r9m3lsMu9Dpb26R/+lQanO9vxFOebnSKCjZ5CkvBknxSP0ZYEFwho6O5OxeDg6BT2TEhP3Ir3v/lqCXcT7KmHbkyijOALN0shEHA89KnfHRdxTcyaXvLztQIbs4DVZpxUlhlakpAGCZysjlQp3TaseoD+Adnc/vwo72wd8ZRk44vEs4bHUwBCUxrwkXzzyLt5XkOSeIWE851H9YwLQ9/qXfFZhNLddtGVTMKMjhsUSD3x7BbuP5IdUdrNTjZ1K68zfzzpzADj0VnlJbjcWeh3yqHdEHf 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:rN8bP8OYA61QUaYb43RG7WeNwXeG65EJwffmTO9YPmQuwnHZ0+Wg9CTSp3Gx3Yk5unSOvFQAfg7bGA4ohz0mPIhRVaDr8fxzS4PGroIySYjSRdy431HSmNNibl4NucH4Q3qytOLD+fcKPH++c5ydsL+i4k27+tyoZIVroY3DOSH/NR+Ktn/4LB99lLsN8YWVh+er5B7XsVlP3k7I8Q9IqfPl8vxSUp59TrXfS5liLBYdLmxlsmHkjeddge5aW/Fp5fmuH+KG0azyF1V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Mca5?= =?us-ascii?Q?kzcRkMnEtU1noXz77jIk8n6eGMsAVqBdhzM7GgeIxPVF4cQQHHPha3Cdg8w8?= =?us-ascii?Q?cdGnO7E9iTeaSFTfiAQbatYz79PPBJNiclvY4s3rcDFjbvqtELFGUh/PzB+R?= =?us-ascii?Q?RVp5l9UR3CV4stvD148aflLzYzu9RizPUhwP85CfLBcgvMfrCSMEtPHQ2/F6?= =?us-ascii?Q?HeoFQOng8BaUX+VcvVJa6GbKyQ7njENBvanWfnKtHLch8HCjPNvXfOwrYJIx?= =?us-ascii?Q?pw2d/SB1WMJjZ+NoCVDEgi0JHiLeXOUCBueh26EHRHPdc/nECiLZZ2lhKWje?= =?us-ascii?Q?TdwuZg7qr9Q1GDVWk3jUHOQ+MYS2fwCciWXROwq22TQH4Mu2tjR847XgLC5D?= =?us-ascii?Q?z5jboIIe0Gticgcbht/j3NrVudQHl4EhRdEm0dU//tVBQgSDZYb/ZGFJ3iJi?= =?us-ascii?Q?P40p8krQdFqTz8S9+9URaX9GdMA02t25tkSgzdZ83vi6Zdz1wJX6IbymWwxG?= =?us-ascii?Q?UGG1Kplxxu1MKMEqIx1+OjEuWuQK1T/4zAPFMdEeFRd6d0hQlv/oj6D22qCX?= =?us-ascii?Q?cBfL+do4H0FN44It6WsNaICjImNpSpunN2jzgVKc+gmAY1LtTO0h10BH4Qx+?= =?us-ascii?Q?rIYniq2/Y4l4J7eZWQX8JE3HMKy42cYeAFn+QWnt0N/xKu1xrPmFu1PpUr9O?= =?us-ascii?Q?VaUFvrg0mspdh/mF7ireBC3qkTwH/otfM1H7ATOSVeH+xjKKy9Hv6vBf4pEv?= =?us-ascii?Q?9KbsCU7q3qsPkT2bjNGjxURkGD8EI0b999feiNJre76k6ZbBdqpIexrxNz5F?= =?us-ascii?Q?beqFHQF/zOlk2gKCE=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB034; 6:Lcj+VVMNcu27lPD6rc88haS56FmyGwVdNNWPwW65CxrWfJ4t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Wu2AzUhLflVf64cxM3hlZhVw3PVsdgVFRJl/OwLUigY3T8x9BtTiJVU7HEAiCGO9RD42s9AmgICYtz5VXWHMQ0OsxJXH2P5lyoSas3UFo7Egjv70O0XjEz7E+cOG/b48MyU5aAZ/cSMysSoNLdXdXj5pHuiQ== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2017 23:36:56.6231 (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 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 Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp Reviewed-by: Hannes Reinecke --- 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 1dde88b0c2c8..3472dcecfb28 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -590,11 +590,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 @@ -621,17 +616,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); @@ -667,8 +651,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", @@ -1738,7 +1720,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; @@ -2016,7 +1997,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); } @@ -2090,7 +2070,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; } @@ -2116,7 +2095,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; } @@ -2141,7 +2119,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; } @@ -2177,7 +2154,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; @@ -2492,9 +2468,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); @@ -2555,6 +2528,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);