diff options
author | Zhu Yanjun <yanjun.zhu@linux.dev> | 2023-09-19 09:37:27 +0200 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-09-19 10:23:17 +0200 |
commit | 20a02837fb5e162764828f6ec1b1f75a5de3fca4 (patch) | |
tree | da0dd2b069cb74daeb87350e51fcd4e61f7d4bc4 | |
parent | RDMA/core: Use size_{add,sub,mul}() in calls to struct_size() (diff) | |
download | linux-20a02837fb5e162764828f6ec1b1f75a5de3fca4.tar.xz linux-20a02837fb5e162764828f6ec1b1f75a5de3fca4.zip |
RDMA/rtrs: Require holding rcu_read_lock explicitly
No functional change. The function get_next_path_rr needs to hold
rcu_read_lock. As such, if no rcu read lock, warnings will pop out.
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Link: https://lore.kernel.org/r/20230919073727.540207-1-yanjun.zhu@intel.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r-- | drivers/infiniband/ulp/rtrs/rtrs-clt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c index b6ee801fd0ff..07261523c554 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -775,7 +775,7 @@ rtrs_clt_get_next_path_or_null(struct list_head *head, struct rtrs_clt_path *clt * Related to @MP_POLICY_RR * * Locks: - * rcu_read_lock() must be hold. + * rcu_read_lock() must be held. */ static struct rtrs_clt_path *get_next_path_rr(struct path_it *it) { @@ -783,6 +783,11 @@ static struct rtrs_clt_path *get_next_path_rr(struct path_it *it) struct rtrs_clt_path *path; struct rtrs_clt_sess *clt; + /* + * Assert that rcu lock must be held + */ + RCU_LOCKDEP_WARN(!rcu_read_lock_held(), "no rcu read lock held"); + clt = it->clt; /* |