Skip to contentSkip to conversation

target:alua: fix the tg_pt_gps_count

PATCH Applied tangwenji 3 participants 3 messages Mar 27, 2019 – Mar 28, 2019 SCSI target

lore
Share & tools
lore

tangwenji

author
#0 lore raw

PATCH v2 1/1 target:alua: fix the tg_pt_gps_count

From: tangwenji <[email protected]>

Reducing the count should be alua_tg_pt_gps_count instead of alua_tg_pt_gps_counter when free alua group.

---
 drivers/target/target_core_alua.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/target/target_core_alua.c +4 -2
index e09f0cf..893f1fe 100644
@@ -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);
 
 	/*
Signature · 1 line
2.5.0.windows.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 17 lines · tangwenji

From: tangwenji <[email protected]>

Reducing the count should be alua_tg_pt_gps_count instead of alua_tg_pt_gps_counter when free alua group.

---
 drivers/target/target_core_alua.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/target/target_core_alua.c +0 -0
index e09f0cf..893f1fe 100644
@@ -1760,8 +1760,10 @@ void core_alua_free_tg_pt_gp(
 	 * can be made while we are releasing struct t10_alua_tg_pt_gp.
 	 */

drivers/target/target_core_alua.c void core_alua_free_tg_pt_gp( · line 1769

Quoted 10 lines
drivers/target/target_core_alua.c +4 -2
 	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);
 
 	/*

Looks ok to me.

#2 lore raw
In reply to tangwenji

tangwenji,

Quoted 2 lines

Reducing the count should be alua_tg_pt_gps_count instead of alua_tg_pt_gps_counter when free alua group.

Applied to 5.2/scsi-queue, thanks.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering