From patchwork Wed Mar 27 13:59:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tangwenji X-Patchwork-Id: 10873531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B28A1390 for ; Wed, 27 Mar 2019 13:58:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71FCE28DE8 for ; Wed, 27 Mar 2019 13:58:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FB5328DF8; Wed, 27 Mar 2019 13:58: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=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,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 E31C628E02 for ; Wed, 27 Mar 2019 13:58:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728066AbfC0N6g (ORCPT ); Wed, 27 Mar 2019 09:58:36 -0400 Received: from m12-13.163.com ([220.181.12.13]:52010 "EHLO m12-13.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727488AbfC0N6g (ORCPT ); Wed, 27 Mar 2019 09:58:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=UriLmEN/ff8/9TdfJO AqbJDuaeIsxeaELwxQw+v8smY=; b=BU97tDgKzhKCaFi0i/KsupjnJ539XjVBSG aNphZHX60kyFQCWApQ0zCUn262Wvd8a8GrYqMWzOTWoCYN4rV34hVSD/GfIFDkXn vRiZwrRUIai2sgpOb+CGvDvBwEFZoRcgr93bRO88LEkKDrzKVtI6yEQO+inirWJV EBu4b2teo= Received: from localhost.localdomain (unknown [183.215.90.10]) by smtp9 (Coremail) with SMTP id DcCowAAnLwd4gZtc25IsMQ--.1886S2; Wed, 27 Mar 2019 21:58:20 +0800 (CST) From: tangwenji To: "Martin K. Petersen" Cc: Mike Christie , target-devel@vger.kernel.org, tangwenji Subject: [PATCH V2] target:alua: fix the tg_pt_gps_count Date: Wed, 27 Mar 2019 21:59:06 +0800 Message-Id: <1553695146-4352-1-git-send-email-hndksztwj@163.com> X-Mailer: git-send-email 2.5.0.windows.1 X-CM-TRANSID: DcCowAAnLwd4gZtc25IsMQ--.1886S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7GrW5Xw4DGrWrJFyrKFW7Arb_yoWDWrX_ur 18t39Fkr4furyDKr1jkFn3Ary5Kwn2vrsYqanYvF42qrnrWrn0kw1DJ3ZrZrWfC393Xr1a k34xWr1fXa1rGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0P73DUUUUU== X-Originating-IP: [183.215.90.10] X-CM-SenderInfo: 5kqgy2h2wzyqqrwthudrp/1tbiLxyEQ1UMLbgVewAAsW 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 From: tangwenji Reducing the count should be alua_tg_pt_gps_count instead of alua_tg_pt_gps_counter when free alua group. Signed-off-by: tangwenji Reviewed-by: Mike Christie --- drivers/target/target_core_alua.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index e09f0cf..893f1fe 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c @@ -1760,8 +1760,10 @@ void core_alua_free_tg_pt_gp( * can be made while we are releasing struct t10_alua_tg_pt_gp. */ spin_lock(&dev->t10_alua.tg_pt_gps_lock); - list_del(&tg_pt_gp->tg_pt_gp_list); - dev->t10_alua.alua_tg_pt_gps_counter--; + if (tg_pt_gp->tg_pt_gp_valid_id) { + list_del(&tg_pt_gp->tg_pt_gp_list); + dev->t10_alua.alua_tg_pt_gps_count--; + } spin_unlock(&dev->t10_alua.tg_pt_gps_lock); /*