Re: [PATCH rdma-next] RDMA/srpt: Fix RCU debug build error

Bart Van Assche
2018-01-23T22:30:08Z

On Tue, 2018-01-23 at 20:57 +0200, Leon Romanovsky wrote:
> So how are we going to solve that rdma/for-next doesn't compile?

How about the following?

[PATCH] IB/srpt: Fix CONFIG_DEBUG_OBJECTS_RCU_HEAD=y build

Avoid that the kernel build fails as follows if RCU debugging is
enabled:

ERROR: "init_rcu_head" [drivers/infiniband/ulp/srpt/ib_srpt.ko] undefined!

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 5ccc75c389e2..a78a79791950 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1977,7 +1977,6 @@ static struct srpt_nexus *srpt_get_nexus(struct srpt_port *sport,
nexus = ERR_PTR(-ENOMEM);
break;
}
- init_rcu_head(&tmp_nexus->rcu);
INIT_LIST_HEAD(&tmp_nexus->ch_list);
memcpy(tmp_nexus->i_port_id, i_port_id, 16);
memcpy(tmp_nexus->t_port_id, t_port_id, 16);
@@ -2147,7 +2146,6 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,
goto reject;
}

- init_rcu_head(&ch->rcu);
kref_init(&ch->kref);
ch->pkey = be16_to_cpu(pkey);
ch->nexus = nexus;