From patchwork Wed Feb 8 22:24:49 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: 9563639 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 11BE06020F for ; Wed, 8 Feb 2017 22:28:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8BA1284F2 for ; Wed, 8 Feb 2017 22:28:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDAF128533; Wed, 8 Feb 2017 22:28:04 +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 808B6284F2 for ; Wed, 8 Feb 2017 22:28:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbdBHW2A (ORCPT ); Wed, 8 Feb 2017 17:28:00 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:63830 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751603AbdBHW1z (ORCPT ); Wed, 8 Feb 2017 17:27:55 -0500 X-IronPort-AV: E=Sophos;i="5.35,348,1483977600"; d="scan'208";a="76618195" Received: from unknown (HELO milsmgep14.sandisk.com) ([63.163.107.225]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2017 06:28: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 E5.72.18895.BCA9B985; Wed, 8 Feb 2017 14:25:16 -0800 (PST) Received: from milsmgip12.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; Wed, 8 Feb 2017 14:25:11 -0800 X-AuditID: 0ac94371-0fadb980000049cf-fb-589b9acb8efd Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id F3.42.18148.7CA9B985; Wed, 8 Feb 2017 14:25:11 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Hannes Reinecke , Christoph Hellwig , Andy Grover , David Disseldorp Subject: [PATCH v4 19/37] target: Simplify session shutdown tests Date: Wed, 8 Feb 2017 14:24:49 -0800 Message-ID: <20170208222507.25715-20-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170208222507.25715-1-bart.vanassche@sandisk.com> References: <20170208222507.25715-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsXCddJ5ke6ZWbMjDB7KWuyf9YzJ4uv/6SwW C97sZbNYufook0Xr0rdMDqweu282sHm833eVzWP9lqssHptPV3t83iQXwBrFZZOSmpNZllqk b5fAlTFhRj9rwUuuil8tM5gaGGdydjFyckgImEjcbu9l7mLk4hASWMok8WLBP1YIZzujxMqH m5m6GDnAquY8koSIb2SUWPb0LhtIN5uAkcS39zNZQGwRAQOJ370XGEFsZoHVjBLXH0qC2MIC jhIblu5jArFZBFQkrh84zgpi8wo4SGw9NIkd4gp5iV1tF8HinEDxCS+fgc0RErCXeHXgCyPI YgmBaawSzydcZ4JoFpQ4OfMJC8QyCYmDL14wQzSoS5xcMp9pAqPQLCRls5CULWBkWsUolpuZ U5ybnlpgaKJXnJiXklmcrZecn7uJERLqhTsYX9/2PsQowMGoxMN7wXp2hBBrYllxZe4hRgkO ZiUR3pRpQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8WbJTI4QE0hNLUrNTUwtSi2CyTBycUg2M PMt59BhPXN42QWWFeeLMsuzcVZIWdrEr9d32d/+yi7x3fa9xhPtdZdXnzzMefuiX8JuwNdR7 jfkxl+uzv8v3VBfv0FMuXWHKkV1XND1Vqvi1vOl5lrTSyA99Corn3a4Jm2+47Rb77d9lDlup x8qVW6fO3SfHanimPvbn0WXOUf0rp33MFrymxFKckWioxVxUnAgAs1EUUHECAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPJMWRmVeSWpSXmKPExsXCtZGTTff4rNkRBn8f61jsn/WMyeLgzzZG i6//p7NYLHizl81i5eqjTBatS98yObB57L7ZwObxft9VNo9pa84zeazfcpXFY/Ppao/Pm+QC 2KK4bFJSczLLUov07RK4MibM6GcteMlV8atlBlMD40zOLkYODgkBE4k5jyS7GLk4hATWM0pM /7iPqYuRk4NNwEji2/uZLCC2iICBxO/eC4wgRcwCaxkl9syYxQqSEBZwlNiwFKKBRUBVomXL PLAGXgEHiTVNm9hAbAkBeYldbRfB6jmB4hNePmMEsYUE7CVeHfjCOIGRewEjwypGsdzMnOLc 9MwCQyO94sS8lMzibL3k/NxNjJAgidrBeH2i+SFGJg5OqQbGYFOfsGVh+6Vepcr5zF/da7y8 YtN+M76KOYw3e3K+c5z+vld1YVXqlD/Xdx28o787Q5vFMYDnw8+mT2Vel8SW7Uud42r/9Fv0 O6FJS4OUljyofySY+GF69N7pSouWe7ken5vtuo5tm9VFn0vRC99dyG9xi/EtiNDjX3R+j6/R r77eJ2e/d7WUK7EUZyQaajEXFScCAHEZOaDCAQAA 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 If se_cmd->cmd_wait_set is set then sess->sess_tearing_down has already been set. Hence change "sess->sess_tearing_down || cmd->cmd_wait_set" into "sess->sess_tearing_down". Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/target_core_tmr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index 980d94277c8d..29d15eb5ebd5 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c @@ -114,7 +114,7 @@ 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 || se_cmd->cmd_wait_set) { + 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); @@ -247,7 +247,7 @@ static void core_tmr_drain_tmr_list( spin_unlock(&sess->sess_cmd_lock); continue; } - if (sess->sess_tearing_down || cmd->cmd_wait_set) { + if (sess->sess_tearing_down) { spin_unlock(&cmd->t_state_lock); spin_unlock(&sess->sess_cmd_lock); continue;