From patchwork Sun Jul 15 23:16:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 10525341 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 13D86602B3 for ; Sun, 15 Jul 2018 23:16:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05DB627F98 for ; Sun, 15 Jul 2018 23:16:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE22C28334; Sun, 15 Jul 2018 23:16:55 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 A215B2654B for ; Sun, 15 Jul 2018 23:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727349AbeGOXlZ (ORCPT ); Sun, 15 Jul 2018 19:41:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41728 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727403AbeGOXlY (ORCPT ); Sun, 15 Jul 2018 19:41:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D480B40122A1; Sun, 15 Jul 2018 23:16:50 +0000 (UTC) Received: from rh2.redhat.com (ovpn-120-206.rdu2.redhat.com [10.10.120.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id 560F376EA; Sun, 15 Jul 2018 23:16:50 +0000 (UTC) From: Mike Christie To: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, nab@linux-iscsi.org Cc: Mike Christie Subject: [PATCH 13/15] iscsi target: check nopin_response_timeout before starting timer Date: Sun, 15 Jul 2018 18:16:29 -0500 Message-Id: <1531696591-8558-14-git-send-email-mchristi@redhat.com> In-Reply-To: <1531696591-8558-1-git-send-email-mchristi@redhat.com> References: <1531696591-8558-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Sun, 15 Jul 2018 23:16:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Sun, 15 Jul 2018 23:16:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mchristi@redhat.com' RCPT:'' 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 next patch will use a iscsi nop as a ping/test IO. For that nop we will allow the user to specify a timeout value that may be different from the hard coded or acl nopin_response_timeout value. This patch adds checks so if the nopin_response_timeout is turned off we do not accidentally turn it on for the user initiated test nop. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/iscsi/iscsi_target_util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 5a645b5..c51c14e 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c @@ -955,7 +955,8 @@ void iscsit_mod_nopin_response_timer(struct iscsi_conn *conn) struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess); spin_lock_bh(&conn->nopin_timer_lock); - if (!(conn->nopin_response_timer_flags & ISCSI_TF_RUNNING)) { + if (!na->nopin_response_timeout || + !(conn->nopin_response_timer_flags & ISCSI_TF_RUNNING)) { spin_unlock_bh(&conn->nopin_timer_lock); return; } @@ -974,7 +975,8 @@ void iscsit_start_nopin_response_timer(struct iscsi_conn *conn) struct iscsi_node_attrib *na = iscsit_tpg_get_node_attrib(sess); spin_lock_bh(&conn->nopin_timer_lock); - if (conn->nopin_response_timer_flags & ISCSI_TF_RUNNING) { + if (!na->nopin_response_timeout || + conn->nopin_response_timer_flags & ISCSI_TF_RUNNING) { spin_unlock_bh(&conn->nopin_timer_lock); return; }