Re: [tipc-discussion] [PATCH net-next 1/1] tipc: fix node reference count bug

2015-12-03 Thread David Miller
From: Jon Maloy 
Date: Wed,  2 Dec 2015 15:19:37 -0500

> Commit 5405ff6e15f40f2f ("tipc: convert node lock to rwlock")
> introduced a bug to the node reference counter handling. When a
> message is successfully sent in the function tipc_node_xmit(),
> we return directly after releasing the node lock, instead of
> continuing and decrementing the node reference counter as we
> should do.
> 
> This commit fixes this bug.
> 
> Signed-off-by: Jon Maloy 

Applied, thanks.

--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911=/4140
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion


[tipc-discussion] [PATCH net-next 1/1] tipc: fix node reference count bug

2015-12-02 Thread Jon Maloy
Commit 5405ff6e15f40f2f ("tipc: convert node lock to rwlock")
introduced a bug to the node reference counter handling. When a
message is successfully sent in the function tipc_node_xmit(),
we return directly after releasing the node lock, instead of
continuing and decrementing the node reference counter as we
should do.

This commit fixes this bug.

Signed-off-by: Jon Maloy 
---
 net/tipc/node.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index 3f7a4ed..fa97d96 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1189,20 +1189,19 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head 
*list,
spin_unlock_bh(>lock);
}
tipc_node_read_unlock(n);
-   if (likely(!skb_queue_empty())) {
+   if (likely(!rc))
tipc_bearer_xmit(net, bearer_id, , >maddr);
-   return 0;
-   }
-   if (unlikely(rc == -ENOBUFS))
+   else if (rc == -ENOBUFS)
tipc_node_link_down(n, bearer_id, false);
tipc_node_put(n);
return rc;
}
 
-   if (unlikely(!in_own_node(net, dnode)))
-   return rc;
-   tipc_sk_rcv(net, list);
-   return 0;
+   if (likely(in_own_node(net, dnode))) {
+   tipc_sk_rcv(net, list);
+   return 0;
+   }
+   return rc;
 }
 
 /* tipc_node_xmit_skb(): send single buffer to destination
-- 
1.9.1


--
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911=/4140
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion