Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218560 > unrolled thread

[PATCH net-next] RDS: rds_conn_lookup() should factor in the struct net for a match

Started bySowmini Varadhan <sowmini.varadhan@oracle.com>
First post2015-09-03 22:30 +0200
Last post2015-09-06 07:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net-next] RDS: rds_conn_lookup() should factor in the struct  net for a match Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-09-03 22:30 +0200
    Re: [PATCH net-next] RDS: rds_conn_lookup() should factor in the  struct net for a match "santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com> - 2015-09-03 22:40 +0200
    Re: [PATCH net-next] RDS: rds_conn_lookup() should factor in the  struct net for a match David Miller <davem@davemloft.net> - 2015-09-06 07:10 +0200

#1218560 — [PATCH net-next] RDS: rds_conn_lookup() should factor in the struct net for a match

FromSowmini Varadhan <sowmini.varadhan@oracle.com>
Date2015-09-03 22:30 +0200
Subject[PATCH net-next] RDS: rds_conn_lookup() should factor in the struct net for a match
Message-ID<q4JiV-5N2-9@gated-at.bofh.it>
Only return a conn if the rds_conn_net(conn) matches the struct
net passed to rds_conn_lookup().

Fixes: 467fa15356ac ("RDS-TCP: Support multiple RDS-TCP listen endpoints,
       one per netns.")

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
 net/rds/connection.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/rds/connection.c b/net/rds/connection.c
index a50e652..9b2de5e 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -70,7 +70,8 @@ static struct hlist_head *rds_conn_bucket(__be32 laddr, __be32 faddr)
 } while (0)
 
 /* rcu read lock must be held or the connection spinlock */
-static struct rds_connection *rds_conn_lookup(struct hlist_head *head,
+static struct rds_connection *rds_conn_lookup(struct net *net,
+					      struct hlist_head *head,
 					      __be32 laddr, __be32 faddr,
 					      struct rds_transport *trans)
 {
@@ -78,7 +79,7 @@ static struct rds_connection *rds_conn_lookup(struct hlist_head *head,
 
 	hlist_for_each_entry_rcu(conn, head, c_hash_node) {
 		if (conn->c_faddr == faddr && conn->c_laddr == laddr &&
-				conn->c_trans == trans) {
+		    conn->c_trans == trans && net == rds_conn_net(conn)) {
 			ret = conn;
 			break;
 		}
@@ -132,7 +133,7 @@ static struct rds_connection *__rds_conn_create(struct net *net,
 	if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP)
 		goto new_conn;
 	rcu_read_lock();
-	conn = rds_conn_lookup(head, laddr, faddr, trans);
+	conn = rds_conn_lookup(net, head, laddr, faddr, trans);
 	if (conn && conn->c_loopback && conn->c_trans != &rds_loop_transport &&
 	    laddr == faddr && !is_outgoing) {
 		/* This is a looped back IB connection, and we're
@@ -239,7 +240,7 @@ static struct rds_connection *__rds_conn_create(struct net *net,
 		if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP)
 			found = NULL;
 		else
-			found = rds_conn_lookup(head, laddr, faddr, trans);
+			found = rds_conn_lookup(net, head, laddr, faddr, trans);
 		if (found) {
 			trans->conn_free(conn->c_transport_data);
 			kmem_cache_free(rds_conn_slab, conn);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1218564 — Re: [PATCH net-next] RDS: rds_conn_lookup() should factor in the struct net for a match

From"santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com>
Date2015-09-03 22:40 +0200
SubjectRe: [PATCH net-next] RDS: rds_conn_lookup() should factor in the struct net for a match
Message-ID<q4JsB-5Y4-3@gated-at.bofh.it>
In reply to#1218560
On 9/3/15 1:24 PM, Sowmini Varadhan wrote:
>
> Only return a conn if the rds_conn_net(conn) matches the struct
> net passed to rds_conn_lookup().
>
> Fixes: 467fa15356ac ("RDS-TCP: Support multiple RDS-TCP listen endpoints,
>         one per netns.")
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> ---

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1219705 — Re: [PATCH net-next] RDS: rds_conn_lookup() should factor in the struct net for a match

FromDavid Miller <davem@davemloft.net>
Date2015-09-06 07:10 +0200
SubjectRe: [PATCH net-next] RDS: rds_conn_lookup() should factor in the struct net for a match
Message-ID<q5Anf-5Q6-3@gated-at.bofh.it>
In reply to#1218560
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Thu, 3 Sep 2015 16:24:52 -0400

> 
> Only return a conn if the rds_conn_net(conn) matches the struct
> net passed to rds_conn_lookup().
> 
> Fixes: 467fa15356ac ("RDS-TCP: Support multiple RDS-TCP listen endpoints,
>        one per netns.")
> 
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web