From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
RDMA mailing list <linux-rdma@vger.kernel.org>,
Parav Pandit <parav@mellanox.com>,
Steve Wise <swise@opengridcomputing.com>
Subject: [PATCH rdma-next 1/2] IB/core: Work on the caller socket net namespace in nldev_newlink()
Date: Thu, 4 Jul 2019 16:04:01 +0300 [thread overview]
Message-ID: <20190704130402.8431-2-leon@kernel.org> (raw)
In-Reply-To: <20190704130402.8431-1-leon@kernel.org>
From: Parav Pandit <parav@mellanox.com>
While creating new RDMA devices based on netdevice name,
consider the net namespace of the caller skb's socket similar to rest of
the doit() callbacks and nldev_dellink() which deletes the RDMA device
created using nldev_newlink().
Fixes: 3856ec4b93c94 ("RDMA/core: Add RDMA_NLDEV_CMD_NEWLINK/DELLINK support")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
drivers/infiniband/core/nldev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index d9f2a30e6467..783e465e7c41 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -1476,7 +1476,7 @@ static int nldev_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
nla_strlcpy(ndev_name, tb[RDMA_NLDEV_ATTR_NDEV_NAME],
sizeof(ndev_name));
- ndev = dev_get_by_name(&init_net, ndev_name);
+ ndev = dev_get_by_name(sock_net(skb->sk), ndev_name);
if (!ndev)
return -ENODEV;
--
2.20.1
next prev parent reply other threads:[~2019-07-04 13:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 13:04 [PATCH rdma-next 0/2] Allow netlink commands in non init_net net namespace Leon Romanovsky
2019-07-04 13:04 ` Leon Romanovsky [this message]
2019-07-04 13:04 ` [PATCH rdma-next 2/2] IB: Support netlink commands in non init_net net namespaces Leon Romanovsky
2019-07-08 20:20 ` Jason Gunthorpe
2019-07-09 6:38 ` Leon Romanovsky
2019-07-09 12:25 ` Jason Gunthorpe
2019-07-09 6:55 ` Parav Pandit
2019-07-04 17:34 ` [PATCH rdma-next 0/2] Allow netlink commands in non init_net net namespace Jason Gunthorpe
2019-07-05 2:12 ` Parav Pandit
2019-07-08 20:21 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190704130402.8431-2-leon@kernel.org \
--to=leon@kernel.org \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=parav@mellanox.com \
--cc=swise@opengridcomputing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox