aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srpt/ib_srpt.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-11-01 13:47:56 -0700
committerJason Gunthorpe <jgg@mellanox.com>2019-11-06 15:13:03 -0400
commit77cf98d4ec90e8c48592c6537cfc2281c58f7ac3 (patch)
tree2431c5bcfc2dfaded3b62ac42007981f8aa07748 /drivers/infiniband/ulp/srpt/ib_srpt.c
parentRDMA/qedr: Remove unsupported modify_port callback (diff)
downloadlinux-dev-77cf98d4ec90e8c48592c6537cfc2281c58f7ac3.tar.xz
linux-dev-77cf98d4ec90e8c48592c6537cfc2281c58f7ac3.zip
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. Link: https://lore.kernel.org/r/20191101204756.182162-1-bvanassche@acm.org Reported-by: Honggang Li <honli@redhat.com> Fixes: 9b64f7d0bb0a ("RDMA/srpt: Postpone HCA removal until after configfs directory removal") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Honggang Li <honli@redhat.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/ulp/srpt/ib_srpt.c')
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index a278e76b9e02..653de1583cf9 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2936,7 +2936,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();
@@ -3733,7 +3733,6 @@ static struct configfs_attribute *srpt_tpg_attrs[] = {
static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn,
const char *name)
{
- struct srpt_port *sport = wwn->priv;
struct srpt_port_id *sport_id = srpt_wwn_to_sport_id(wwn);
struct srpt_tpg *stpg;
int res = -ENOMEM;
@@ -3752,8 +3751,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;
}
@@ -3774,7 +3771,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);
}
/**