From patchwork Fri Feb 10 01:28:41 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: 9565771 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 39A5860573 for ; Fri, 10 Feb 2017 01:29:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29F8D28556 for ; Fri, 10 Feb 2017 01:29:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E4BD28564; Fri, 10 Feb 2017 01:29:37 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 B79F028552 for ; Fri, 10 Feb 2017 01:29:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751452AbdBJB3c (ORCPT ); Thu, 9 Feb 2017 20:29:32 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:18628 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbdBJB33 (ORCPT ); Thu, 9 Feb 2017 20:29:29 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="82349524" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 10 Feb 2017 09:29:00 +0800 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 70.97.57638.C571D985; Thu, 9 Feb 2017 17:29:00 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Thu, 9 Feb 2017 17:28:56 -0800 X-AuditID: 0ac94369-26dee9800001e126-fe-589d175ce6c1 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id A5.9F.11415.7571D985; Thu, 9 Feb 2017 17:28:55 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche , Hannes Reinecke , Christoph Hellwig , Andy Grover , David Disseldorp Subject: [PATCH v5 11/22] target: Remove several state tests from the TMF code Date: Thu, 9 Feb 2017 17:28:41 -0800 Message-ID: <20170210012852.15735-12-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170210012852.15735-1-bart.vanassche@sandisk.com> References: <20170210012852.15735-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsXCddJ5kW6M+NwIgwOzFS32z3rGZPH1/3QW iwVv9rJZrFx9lMmibfUZRovWpW+ZHNg87m8/wuSx+2YDm8f7fVfZPNZvucrisfl0tcfnTXIB bFFcNimpOZllqUX6dglcGVO/3mMtOM9bceZQK1sD4wruLkZODgkBE4m7V5azdjFycQgJLGWS ODTrCAuEs51R4u6SVnaYqq2zbjJBJDYyStxvOcoCkmATMJL49n4mmC0CZK/uWQZWxCxwm1Fi zePVbCAJYQE/iUlnd7CC2CwCKhJNk96B2bwCDhIvZp9jhNggL7Gr7SJYnBMo/mr2dSCbA2ib vcSOXQYQJYtYJf6tYYdoFZQ4OfMJ2F5mAQmJgy9eMIPYQgLqEieXzGeawCg0C0nZLCRlCxiZ VjGK5WbmFOempxYYmuoVJ+alZBZn6yXn525ihERA5g7Gu0+8DzEKcDAq8fC+qJkTIcSaWFZc mXuIUYKDWUmE9z7f3Agh3pTEyqrUovz4otKc1OJDjNIcLErivOdkpkYICaQnlqRmp6YWpBbB ZJk4OKUaGOemvXy0LZVzs8T/xNhZVnyWJ2TE9tqkiYpvKtLN9zXIWTlrz+Up7zrW7lcS6f5Y saTLUdBWymTTztdcfnUJAgzXJz/3OeO9WHXiVt62ghXzn23b+DZ1TUzMzK2LW2ZZHXzs4vXn 1YO7vetmWRQand5dOKFj99455i4J/804JQxbf3bK7NVWS1BiKc5INNRiLipOBADJO6GsfAIA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJMWRmVeSWpSXmKPExsXCtZGTTTdcfG6Eweupshb7Zz1jsjj4s43R 4uv/6SwWC97sZbNYufook0Xb6jOMFq1L3zI5sHvc336EyWP3zQY2j/f7rrJ5TFtznslj/Zar LB6bT1d7fN4kF8AexWWTkpqTWZZapG+XwJUx9es91oLzvBVnDrWyNTCu4O5i5OSQEDCR2Drr JlMXIxeHkMB6Rok9lx+wgCTYBIwkvr2fCWaLANmre5aBFTEL3GWUONP9iQ0kISzgJzHp7A5W EJtFQFXi+MtDzF2MHBy8Ag4Siw8KQCyQl9jVdhGshBMo/Gr2dVaQEiEBe4kduwwmMHIvYGRY xSiWm5lTnJueWWBoqFecmJeSWZytl5yfu4kREjaROxifTjQ/xMjEwSnVwDg5+pZVW/AJ+6lq 0/pmTzMoXSXf5MZ77mjOwS97Z+1PW6CtdOeIyAqFVUmm12XrLjVqaojMkS58dNLwQtTkvXwV 0oYv+WKCGjNcup8In73LKl8u+eLC51X/Cl6kftFcPD1KcePpW3GLC7a5xLq+SE1fpf/V2j4q ae/Kfx1+pxXTDF2l3k98KaPEUpyRaKjFXFScCAAs28FWywEAAA== MIME-Version: 1.0 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 Whether or not a session is being torn down does not affect whether or not SCSI commands are in the task set. Hence remove the "tearing down" checks from the TMF code. The TRANSPORT_ISTATE_PROCESSING check is left out because it is now safe to wait for a command that is in that state. Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/target_core_tmr.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index 7b8e2a33bdff..75ef294106c3 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c @@ -114,12 +114,6 @@ static bool __target_check_io_state(struct se_cmd *se_cmd, spin_unlock(&se_cmd->t_state_lock); return false; } - if (sess->sess_tearing_down) { - pr_debug("Attempted to abort io tag: %llu already shutdown," - " skipping\n", se_cmd->tag); - spin_unlock(&se_cmd->t_state_lock); - return false; - } se_cmd->transport_state |= CMD_T_ABORTED; if ((tmr_sess != se_cmd->se_sess) && tas) @@ -234,16 +228,6 @@ static void core_tmr_drain_tmr_list( spin_unlock(&sess->sess_cmd_lock); continue; } - if (cmd->t_state == TRANSPORT_ISTATE_PROCESSING) { - spin_unlock(&cmd->t_state_lock); - spin_unlock(&sess->sess_cmd_lock); - continue; - } - if (sess->sess_tearing_down) { - spin_unlock(&cmd->t_state_lock); - spin_unlock(&sess->sess_cmd_lock); - continue; - } cmd->transport_state |= CMD_T_ABORTED; spin_unlock(&cmd->t_state_lock);