From patchwork Tue Mar 4 00:01:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 3757991 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B09529F1EE for ; Tue, 4 Mar 2014 00:23:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF0F6203E5 for ; Tue, 4 Mar 2014 00:23:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07F02203B0 for ; Tue, 4 Mar 2014 00:23:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755882AbaCDAXO (ORCPT ); Mon, 3 Mar 2014 19:23:14 -0500 Received: from mail-ob0-f174.google.com ([209.85.214.174]:54675 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755866AbaCDAXL (ORCPT ); Mon, 3 Mar 2014 19:23:11 -0500 Received: by mail-ob0-f174.google.com with SMTP id wo20so5299384obc.19 for ; Mon, 03 Mar 2014 16:23:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BNLsTKNbph0PpOLfGdLQsONwOedo58PPrNGX32z/0lM=; b=iUx+ScTYKAPNO9cxY8nyaSuuB5ELvtw06AjFqxgXs5S4ZU/c60ZzLqC4tTtD6m4ea6 FC8n8KFhZIZDbn/Up+jlBmf67xQDZKiZFQP/DziolOH/LveMOaRiBAO7AtC3HzysroOj zArJxveY07dPIJFkp0UW67c7rZPyKPK3x/Ggedo74R1XCqtHCLmfRGr/Q4um9a3HN1uH YU13noumn67vRsZG3j0wd1bGM3tlYEBqrAZvAyFkpjKfGh3ODoTI62Alf1ndpNpA7v/g bhV69vYLHl3qQPtNPazweBORsG9MU3gIIhjTI0tTe+ofuKJaIcPj5N0cLaPhEB6fMHI6 zCKA== X-Gm-Message-State: ALoCoQl6WCSi/TYz9elQBHS96ZA6GtmPOj26e9kxfw93Q+K2y+2+ohJ8IlZ8+q70fDxjH2eUR/FL X-Received: by 10.60.68.163 with SMTP id x3mr8170167oet.49.1393892591144; Mon, 03 Mar 2014 16:23:11 -0800 (PST) Received: from localhost.localdomain (mail.linux-iscsi.org. [67.23.28.174]) by mx.google.com with ESMTPSA id lh7sm85755278oeb.6.2014.03.03.16.23.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Mar 2014 16:23:10 -0800 (PST) From: "Nicholas A. Bellinger" To: target-devel Cc: linux-rdma , linux-scsi , Or Gerlitz , Sagi Grimberg , Nicholas Bellinger Subject: [PATCH 1/6] iscsi-target: Fix iscsit_get_tpg_from_np tpg_state bug Date: Tue, 4 Mar 2014 00:01:00 +0000 Message-Id: <1393891265-22910-2-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1393891265-22910-1-git-send-email-nab@daterainc.com> References: <1393891265-22910-1-git-send-email-nab@daterainc.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicholas Bellinger This patch fixes a bug in iscsit_get_tpg_from_np() where the tpg->tpg_state sanity check was looking for TPG_STATE_FREE, instead of != TPG_STATE_ACTIVE. The latter is expected during a normal TPG shutdown once the tpg_state goes into TPG_STATE_INACTIVE in order to reject any new incoming login attempts. Signed-off-by: Nicholas Bellinger --- drivers/target/iscsi/iscsi_target_tpg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 3976183..44a5471 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -137,7 +137,7 @@ struct iscsi_portal_group *iscsit_get_tpg_from_np( list_for_each_entry(tpg, &tiqn->tiqn_tpg_list, tpg_list) { spin_lock(&tpg->tpg_state_lock); - if (tpg->tpg_state == TPG_STATE_FREE) { + if (tpg->tpg_state != TPG_STATE_ACTIVE) { spin_unlock(&tpg->tpg_state_lock); continue; }