Message ID | 20161228124728.26619-9-leon@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On Wed, Dec 28, 2016 at 02:47:27PM +0200, Leon Romanovsky wrote: > From: Feras Daoud <ferasda@mellanox.com> Any reason why this patch, out of 3 in this patch set uses "Replace" instead of "Change" in commit header? Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> > > In order to resolve a situation where a few process delete > the same list element in sequence and cause panic, list_del > 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
On Mon, Jan 02, 2017 at 02:29:18PM +0200, Yuval Shaia wrote: > On Wed, Dec 28, 2016 at 02:47:27PM +0200, Leon Romanovsky wrote: > > From: Feras Daoud <ferasda@mellanox.com> > > Any reason why this patch, out of 3 in this patch set uses "Replace" > instead of "Change" in commit header? No real reason. > > Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> Thank you for your reviewes.
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); } }