All of lore.kernel.org
 help / color / mirror / Atom feed
From: tangwenji <hndksztwj@163.com>
To: target-devel@vger.kernel.org
Subject: [PATCH V2] target:alua: fix the tg_pt_gps_count
Date: Wed, 27 Mar 2019 13:59:06 +0000	[thread overview]
Message-ID: <1553695146-4352-1-git-send-email-hndksztwj@163.com> (raw)

From: tangwenji <tang.wenji@zte.com.cn>

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 <tang.wenji@zte.com.cn>
---
 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);
 
 	/*
-- 
2.5.0.windows.1

             reply	other threads:[~2019-03-27 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 13:59 tangwenji [this message]
2019-03-27 19:43 ` [PATCH V2] target:alua: fix the tg_pt_gps_count Mike Christie
2019-03-28  0:33 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1553695146-4352-1-git-send-email-hndksztwj@163.com \
    --to=hndksztwj@163.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.