From patchwork Wed Feb 15 00:26:04 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: 9573107 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 3090F600F6 for ; Wed, 15 Feb 2017 00:26:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 241E1267EC for ; Wed, 15 Feb 2017 00:26:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18F2827E5A; Wed, 15 Feb 2017 00:26:58 +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 BAEB5281E1 for ; Wed, 15 Feb 2017 00:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751352AbdBOA05 (ORCPT ); Tue, 14 Feb 2017 19:26:57 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:61609 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbdBOA0y (ORCPT ); Tue, 14 Feb 2017 19:26:54 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="86867930" Received: from unknown (HELO milsmgep14.sandisk.com) ([63.163.107.225]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2017 08:26:22 +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 72.FB.18895.D20A3A85; Tue, 14 Feb 2017 16:26:22 -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; Tue, 14 Feb 2017 16:26:16 -0800 X-AuditID: 0ac94371-0fadb980000049cf-40-58a3a02d42d6 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 61.8D.11415.720A3A85; Tue, 14 Feb 2017 16:26:15 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche , Hannes Reinecke , Christoph Hellwig , Andy Grover , David Disseldorp Subject: [PATCH v6 25/33] target: Remove several state tests from the TMF code Date: Tue, 14 Feb 2017 16:26:04 -0800 Message-ID: <20170215002612.14566-26-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170215002612.14566-1-bart.vanassche@sandisk.com> References: <20170215002612.14566-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsXCddJ5ka7egsURBtNPCFvsn/WMyeLr/+ks Fgve7GWzWLn6KJNF2+ozjBatS98yObB53N9+hMlj980GNo/3+66yeazfcpXFY/Ppao/Pm+QC 2KK4bFJSczLLUov07RK4MtYen8BecJ+3Ys13zwbGbdxdjJwcEgImEs3nn7J3MXJxCAksZZL4 2r6fCcLZwSjReu43G0zVmjlbWSESGxkltq9rZgJJsAkYSXx7P5MFxBYBslf3LAPrZha4zSix 5vFqsG5hAT+J739ngBWxCKhKHF18F8zmFXCQ+NW5hBlig7zErraLrCA2J1B8xo6TQDUcQNvs JR6dsQaZKSEwj1Xiw8Z2ZoheQYmTM5+AzWEWkJA4+OIFWFxIQF3i5JL5TBMYhWYhKZuFpGwB I9MqRrHczJzi3PTUAkMTveLEvJTM4my95PzcTYyQCCjcwfj6tvchRgEORiUe3hOyiyOEWBPL iitzDzFKcDArifCy1QOFeFMSK6tSi/Lji0pzUosPMUpzsCiJ82bJTo0QEkhPLEnNTk0tSC2C yTJxcEo1MPpf1/y4lTHvffS6dBW78ArJnwneVmpSmkKRXb8f/t/Ld32Hl9tZ/xUM+UtqXnCc 6Xj4/N+L20n5sTN+W5Wt2XlIQK5p8pRnxgvlxNLPHBQ9u1saqEGxWiMwvufP00XGbTWNJzff niv7+fCjGXYzs51mcGkr/zQturPxll6LXM6/ij/f3QprlFiKMxINtZiLihMBaOvI2nwCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJMWRmVeSWpSXmKPExsXCtZGTTVd9weIIg8sn9Sz2z3rGZHHwZxuj xdf/01ksFrzZy2axcvVRJou21WcYLVqXvmVyYPe4v/0Ik8fumw1sHu/3XWXzmLbmPJPH+i1X WTw2n672+LxJLoA9issmJTUnsyy1SN8ugStj7fEJ7AX3eSvWfPdsYNzG3cXIySEhYCKxZs5W 1i5GLg4hgfWMEj8vbGECSbAJGEl8ez+TBcQWAbJX9yxjAiliFrjLKHGm+xMbSEJYwE/i+98Z YEUsAqoSRxffBbN5BRwkLm66xQKxQV5iV9tFVhCbEyg+Y8dJoDgH0DZ7iUdnrCcwci9gZFjF KJabmVOcm55ZYGioV5yYl5JZnK2XnJ+7iRESNpE7GJ9OND/EyMTBKdXAmCWbG57t4pLnZvNd zTxjh72C0OQS9u3vEravu7vpmjNz8dwDlkI/w0qboqcL+c+0DLop56ip3MmQ8iOnmv35Xc7j y+3U3A/7rH4vMmV59avz/FN7DDOmBk1s2j25d9JR/wPbKts5rydK1S247HVub5YoSwVH5fnO hts/+dqFdlTPUP6yoTVKiaU4I9FQi7moOBEAGAYLsMsBAAA= 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 109ae5e9e995..bd5ada93c434 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, u32 skip_flags, 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) @@ -238,16 +232,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);