* [PATCH] target:alua: fix the tg_pt_gps_count
@ 2019-03-13 14:07 tangwenji
2019-03-20 16:50 ` Mike Christie
0 siblings, 1 reply; 2+ messages in thread
From: tangwenji @ 2019-03-13 14:07 UTC (permalink / raw)
To: target-devel
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index e09f0cf..4808654 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -1761,7 +1761,7 @@ void core_alua_free_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--;
+ dev->t10_alua.alua_tg_pt_gps_count--;
spin_unlock(&dev->t10_alua.tg_pt_gps_lock);
/*
--
2.5.0.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] target:alua: fix the tg_pt_gps_count
2019-03-13 14:07 [PATCH] target:alua: fix the tg_pt_gps_count tangwenji
@ 2019-03-20 16:50 ` Mike Christie
0 siblings, 0 replies; 2+ messages in thread
From: Mike Christie @ 2019-03-20 16:50 UTC (permalink / raw)
To: target-devel
On 03/13/2019 09:07 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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
> index e09f0cf..4808654 100644
> --- a/drivers/target/target_core_alua.c
> +++ b/drivers/target/target_core_alua.c
> @@ -1761,7 +1761,7 @@ void core_alua_free_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--;
> + dev->t10_alua.alua_tg_pt_gps_count--;
> spin_unlock(&dev->t10_alua.tg_pt_gps_lock);
>
I think because its always decremented here we could end up going
negative. If userspace does not call into
target_tg_pt_gp_tg_pt_gp_id_store or it fails, then we will not have
done a count++ and not added it to the list in core_alua_set_tg_pt_gp_id.
I think above above we need to do:
if (tg_pt_gp_valid_id) {
list_del(&tg_pt_gp->tg_pt_gp_list)
dev->t10_alua.alua_tg_pt_gps_count--;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-20 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-13 14:07 [PATCH] target:alua: fix the tg_pt_gps_count tangwenji
2019-03-20 16:50 ` Mike Christie
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.