Message ID | 20161227133911.14340-9-leon@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Tue, Dec 27, 2016 at 03:39:10PM +0200, Leon Romanovsky wrote: > From: Feras Daoud <ferasda@mellanox.com> > > In order to resolve a situation where a few process delete > the same list element in sequence and cause panic, list_del s/"the same list element"/"the same neigh element" Assuming this applies to handling neigh list and not a general rule we shall stick to. In this case suggesting a minor rephrasing of the commit message. Besides that: Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> > is replaced with list_del_init. In this case if the first > process that calls list_del releases the lock before acquiring > it again, other processes who can acquire the lock will call > list_del_init. > > Fixes: b63b70d87741 ("IPoIB: Use a private hash table for path lookup") > Signed-off-by: Feras Daoud <ferasda@mellanox.com> > Signed-off-by: Erez Shitrit <erezsh@mellanox.com> > Reviewed-by: Alex Vesker <valex@mellanox.com> > Signed-off-by: Leon Romanovsky <leon@kernel.org> > --- > drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c > index b5e1e4d..d8af197 100644 > --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c > +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c > @@ -1298,7 +1298,7 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) > rcu_dereference_protected(neigh->hnext, > lockdep_is_held(&priv->lock))); > /* remove from path/mc list */ > - list_del(&neigh->list); > + list_del_init(&neigh->list); > call_rcu(&neigh->rcu, ipoib_neigh_reclaim); > } else { > np = &neigh->hnext; > @@ -1462,7 +1462,7 @@ void ipoib_neigh_free(struct ipoib_neigh *neigh) > rcu_dereference_protected(neigh->hnext, > lockdep_is_held(&priv->lock))); > /* remove from parent list */ > - list_del(&neigh->list); > + list_del_init(&neigh->list); > call_rcu(&neigh->rcu, ipoib_neigh_reclaim); > return; > } else { > @@ -1547,7 +1547,7 @@ void ipoib_del_neighs_by_gid(struct net_device *dev, u8 *gid) > rcu_dereference_protected(neigh->hnext, > lockdep_is_held(&priv->lock))); > /* remove from parent list */ > - list_del(&neigh->list); > + list_del_init(&neigh->list); > call_rcu(&neigh->rcu, ipoib_neigh_reclaim); > } else { > np = &neigh->hnext; > @@ -1589,7 +1589,7 @@ static void ipoib_flush_neighs(struct ipoib_dev_priv *priv) > rcu_dereference_protected(neigh->hnext, > lockdep_is_held(&priv->lock))); > /* remove from path/mc list */ > - list_del(&neigh->list); > + list_del_init(&neigh->list); > call_rcu(&neigh->rcu, ipoib_neigh_reclaim); > } > } > -- > 2.10.2 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index b5e1e4d..d8af197 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1298,7 +1298,7 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) rcu_dereference_protected(neigh->hnext, lockdep_is_held(&priv->lock))); /* remove from path/mc list */ - list_del(&neigh->list); + list_del_init(&neigh->list); call_rcu(&neigh->rcu, ipoib_neigh_reclaim); } else { np = &neigh->hnext; @@ -1462,7 +1462,7 @@ void ipoib_neigh_free(struct ipoib_neigh *neigh) rcu_dereference_protected(neigh->hnext, lockdep_is_held(&priv->lock))); /* remove from parent list */ - list_del(&neigh->list); + list_del_init(&neigh->list); call_rcu(&neigh->rcu, ipoib_neigh_reclaim); return; } else { @@ -1547,7 +1547,7 @@ void ipoib_del_neighs_by_gid(struct net_device *dev, u8 *gid) rcu_dereference_protected(neigh->hnext, lockdep_is_held(&priv->lock))); /* remove from parent list */ - list_del(&neigh->list); + list_del_init(&neigh->list); call_rcu(&neigh->rcu, ipoib_neigh_reclaim); } else { np = &neigh->hnext; @@ -1589,7 +1589,7 @@ static void ipoib_flush_neighs(struct ipoib_dev_priv *priv) rcu_dereference_protected(neigh->hnext, lockdep_is_held(&priv->lock))); /* remove from path/mc list */ - list_del(&neigh->list); + list_del_init(&neigh->list); call_rcu(&neigh->rcu, ipoib_neigh_reclaim); } }