Skip to contentSkip to conversation

Revert "RDMA/srpt: Postpone HCA removal until after configfs directory removal"

PATCH Applied Bart Van Assche 3 participants 3 messages Nov 1, 2019 – Nov 6, 2019

Subsystems (2)
lore
Share & tools
lore

Bart Van Assche

author maintainer
#0 lore raw

PATCH 1/1 Revert "RDMA/srpt: Postpone HCA removal until after configfs directory removal"

Although the mentioned patch fixes a use-after-free bug, it introduces a hang during shutdown. Since the latter is worse, revert this patch.

Cc Honggang Li <[email protected]>
Cc Laurence Oberman <[email protected]>
Fixes 9b64f7d0bb0a ("RDMA/srpt: Postpone HCA removal until after configfs directory removal")
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +1 -4
index c9972b686c27..53dec7d9829c 100644
@@ -2960,7 +2960,7 @@ static int srpt_release_sport(struct srpt_port *sport)
 
 	while (atomic_read(&sport->refcount) > 0 &&
 	       wait_for_completion_timeout(&c, 5 * HZ) <= 0) {
-		pr_info("%s_%d: waiting for unregistration of %d sessions and configfs directories ...\n",
+		pr_info("%s_%d: waiting for unregistration of %d sessions ...\n",
 			dev_name(&sport->sdev->device->dev), sport->port,
 			atomic_read(&sport->refcount));
 		rcu_read_lock();
@@ -3776,8 +3776,6 @@ static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn,
 	list_add_tail(&stpg->entry, &sport_id->tpg_list);
 	mutex_unlock(&sport_id->mutex);
 
-	atomic_inc(&sport->refcount);
-
 	return &stpg->tpg;
 }
 
@@ -3798,7 +3796,6 @@ static void srpt_drop_tpg(struct se_portal_group *tpg)
 	sport->enabled = false;
 	core_tpg_deregister(tpg);
 	kfree(stpg);
-	srpt_drop_sport_ref(sport);
 }
 
 /**
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 35 lines · Bart Van Assche

Although the mentioned patch fixes a use-after-free bug, it introduces a hang during shutdown. Since the latter is worse, revert this patch.

Cc Honggang Li <[email protected]>
Cc Laurence Oberman <[email protected]>
Fixes 9b64f7d0bb0a ("RDMA/srpt: Postpone HCA removal until after configfs directory removal")
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +1 -3
index c9972b686c27..53dec7d9829c 100644
@@ -2960,7 +2960,7 @@ static int srpt_release_sport(struct srpt_port *sport)
 
 	while (atomic_read(&sport->refcount) > 0 &&
 	       wait_for_completion_timeout(&c, 5 * HZ) <= 0) {
-		pr_info("%s_%d: waiting for unregistration of %d sessions and configfs directories ...\n",
+		pr_info("%s_%d: waiting for unregistration of %d sessions ...\n",
 			dev_name(&sport->sdev->device->dev), sport->port,
 			atomic_read(&sport->refcount));
 		rcu_read_lock();
@@ -3776,8 +3776,6 @@ static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn,
 	list_add_tail(&stpg->entry, &sport_id->tpg_list);
 	mutex_unlock(&sport_id->mutex);
 
-	atomic_inc(&sport->refcount);
-
 	return &stpg->tpg;
 }
 

drivers/infiniband/ulp/srpt/ib_srpt.c static void srpt_drop_tpg(struct se_portal_group *tpg) · line 3800

Quoted 6 lines
drivers/infiniband/ulp/srpt/ib_srpt.c +0 -1
@@ -3798,7 +3796,6 @@ static void srpt_drop_tpg(struct se_portal_group *tpg)
 	sport->enabled = false;
 	core_tpg_deregister(tpg);
 	kfree(stpg);
-	srpt_drop_sport_ref(sport);
 }
 
Quoted 4 lines
drivers/infiniband/ulp/srpt/ib_srpt.c +0 -0
 /**
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#2 lore raw
In reply to Bart Van Assche
Quoted 9 lines · Bart Van Assche

Although the mentioned patch fixes a use-after-free bug, it introduces a hang during shutdown. Since the latter is worse, revert this patch.

Cc Honggang Li <[email protected]>
Cc Laurence Oberman <[email protected]>
Fixes 9b64f7d0bb0a ("RDMA/srpt: Postpone HCA removal until after configfs directory removal")
Quoted 3 lines
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Applied to for-next, thanks

Jason