]> git.proxmox.com Git - pve-kernel-2.6.32.git/blame - fix-ipoib-add-missing-lock.patch
bump version to 2.6.32-102
[pve-kernel-2.6.32.git] / fix-ipoib-add-missing-lock.patch
CommitLineData
91d8a35c
DM
1From fa16ebed31f336e41970f3f0ea9e8279f6be2d27 Mon Sep 17 00:00:00 2001
2From: Shlomo Pongratz <shlomop@mellanox.com>
3Date: Mon, 13 Aug 2012 14:39:49 +0000
4Subject: IB/ipoib: Add missing locking when CM object is deleted
5
6Commit b63b70d87741 ("IPoIB: Use a private hash table for path lookup
7in xmit path") introduced a bug where in ipoib_cm_destroy_tx() a CM
8object is moved between lists without any supported locking. Under a
9stress test, this eventually leads to list corruption and a crash.
10
11Previously when this routine was called, callers were taking the
12device priv lock. Currently this function is called from the RCU
13callback associated with neighbour deletion. Fix the race by taking
14the same lock we used to before.
15
16Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
17Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
18Signed-off-by: Roland Dreier <roland@purestorage.com>
19---
20diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
21index 95ecf4e..24683fd 100644
22--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
23+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
24@@ -1271,12 +1271,15 @@ struct ipoib_cm_tx *ipoib_cm_create_tx(struct net_device *dev, struct ipoib_path
25 void ipoib_cm_destroy_tx(struct ipoib_cm_tx *tx)
26 {
27 struct ipoib_dev_priv *priv = netdev_priv(tx->dev);
28+ unsigned long flags;
29 if (test_and_clear_bit(IPOIB_FLAG_INITIALIZED, &tx->flags)) {
30+ spin_lock_irqsave(&priv->lock, flags);
31 list_move(&tx->list, &priv->cm.reap_list);
32 queue_work(ipoib_workqueue, &priv->cm.reap_task);
33 ipoib_dbg(priv, "Reap connection for gid %pI6\n",
34 tx->neigh->daddr + 4);
35 tx->neigh = NULL;
36+ spin_unlock_irqrestore(&priv->lock, flags);
37 }
38 }
39
40--
41cgit v0.9.1