[ofa-general] [PATCH] IB/ipoib: fix stale connection handling

Michael S. Tsirkin mst at dev.mellanox.co.il
Mon Mar 19 23:41:30 PDT 2007


time_after_eq() replaces elements whose timer has not yet expired. Instead, one
must use time_before_eq().

Noted by Pradeep <pradeep at us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst at dev.mellanox.co.il>

---

> I see a trivial bug in ipoib_cm_stale_task (). The time_after_eq() 
> replaces elements whose timer has not yet expired. Instead, one must use 
> time_before_eq(). Should I supply a patch for this?
> 
> Pradeep
> pradeep at us.ibm.com

Good catch, thanks!

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 3484e8b..4675640 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1095,7 +1095,7 @@ static void ipoib_cm_stale_task(struct work_struct *work)
 		/* List if sorted by LRU, start from tail,
 		 * stop when we see a recently used entry */
 		p = list_entry(priv->cm.passive_ids.prev, typeof(*p), list);
-		if (time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_TIMEOUT))
+		if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_TIMEOUT))
 			break;
 		list_del_init(&p->list);
 		spin_unlock_irqrestore(&priv->lock, flags);

-- 
MST



More information about the general mailing list