diff mbox series

[V2] target:alua: fix the tg_pt_gps_count

Message ID 1553695146-4352-1-git-send-email-hndksztwj@163.com (mailing list archive)
State Accepted
Headers show
Series [V2] target:alua: fix the tg_pt_gps_count | expand

Commit Message

tangwenji March 27, 2019, 1:59 p.m. UTC
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(-)

Comments

Mike Christie March 27, 2019, 7:43 p.m. UTC | #1
On 03/27/2019 08:59 AM, tangwenji wrote:
> 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);
>  
>  	/*
> 

Looks ok to me.

Reviewed-by: Mike Christie <mchristi@redhat.com>
Martin K. Petersen March 28, 2019, 12:33 a.m. UTC | #2
tangwenji,

> 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.
diff mbox series

Patch

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);
 
 	/*