* [PATCH] IB/ipoib: Fix RCU annotations in ipoib_neigh_hash_init()
@ 2015-05-26 13:03 Bart Van Assche
[not found] ` <55646F34.9010803-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2015-05-26 13:03 UTC (permalink / raw)
To: Doug Ledford; +Cc: Shlomo Pongratz, linux-rdma
Avoid that sparse complains about ipoib_neigh_hash_init(). This
patch does not change any functionality. See also patch "IPoIB:
Fix memory leak in the neigh table deletion flow" (commit ID
66172c09938b).
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Shlomo Pongratz <shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 9e1b203..fec8207 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1128,7 +1128,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
{
struct ipoib_neigh_table *ntbl = &priv->ntbl;
struct ipoib_neigh_hash *htbl;
- struct ipoib_neigh **buckets;
+ struct ipoib_neigh __rcu **buckets;
u32 size;
clear_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags);
@@ -1146,7 +1146,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
htbl->size = size;
htbl->mask = (size - 1);
htbl->buckets = buckets;
- ntbl->htbl = htbl;
+ RCU_INIT_POINTER(ntbl->htbl, htbl);
htbl->ntbl = ntbl;
atomic_set(&ntbl->entries, 0);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] IB/ipoib: Fix RCU annotations in ipoib_neigh_hash_init()
[not found] ` <55646F34.9010803-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2015-05-26 15:55 ` Doug Ledford
0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2015-05-26 15:55 UTC (permalink / raw)
To: Bart Van Assche; +Cc: Shlomo Pongratz, linux-rdma
[-- Attachment #1: Type: text/plain, Size: 1557 bytes --]
On Tue, 2015-05-26 at 15:03 +0200, Bart Van Assche wrote:
> Avoid that sparse complains about ipoib_neigh_hash_init(). This
> patch does not change any functionality. See also patch "IPoIB:
> Fix memory leak in the neigh table deletion flow" (commit ID
> 66172c09938b).
>
> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Cc: Shlomo Pongratz <shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> index 9e1b203..fec8207 100644
> --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> @@ -1128,7 +1128,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
> {
> struct ipoib_neigh_table *ntbl = &priv->ntbl;
> struct ipoib_neigh_hash *htbl;
> - struct ipoib_neigh **buckets;
> + struct ipoib_neigh __rcu **buckets;
> u32 size;
>
> clear_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags);
> @@ -1146,7 +1146,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
> htbl->size = size;
> htbl->mask = (size - 1);
> htbl->buckets = buckets;
> - ntbl->htbl = htbl;
> + RCU_INIT_POINTER(ntbl->htbl, htbl);
> htbl->ntbl = ntbl;
> atomic_set(&ntbl->entries, 0);
>
Thanks, applied.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-26 15:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 13:03 [PATCH] IB/ipoib: Fix RCU annotations in ipoib_neigh_hash_init() Bart Van Assche
[not found] ` <55646F34.9010803-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-05-26 15:55 ` Doug Ledford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox