[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DB9PR05MB907879CBF037AC6D916EF08C880CA@DB9PR05MB9078.eurprd05.prod.outlook.com>
Date: Mon, 7 Aug 2023 00:25:55 +0000
From: Tung Quang Nguyen <tung.q.nguyen@...tech.com.au>
To: "yang.yang29@....com.cn" <yang.yang29@....com.cn>,
"jmaloy@...hat.com" <jmaloy@...hat.com>,
"davem@...emloft.net" <davem@...emloft.net>
CC: "ying.xue@...driver.com" <ying.xue@...driver.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] net: tipc: add net device refcount tracker for bearer
>Add net device refcount tracker to the struct tipc_bearer.
>
>Signed-off-by: xu xin <xu.xin16@....com.cn>
>Reviewed-by: Yang Yang <yang.yang.29@....com.cn>
>Cc: Kuang Mingfu <kuang.mingfu@....com.cn>
>---
> net/tipc/bearer.c | 10 +++++-----
> net/tipc/bearer.h | 1 +
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
>diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 2cde375477e3..01ffd1f2337a 100644
>--- a/net/tipc/bearer.c
>+++ b/net/tipc/bearer.c
>@@ -426,15 +426,15 @@ int tipc_enable_l2_media(struct net *net, struct tipc_bearer *b,
> struct net_device *dev;
>
> /* Find device with specified name */
>- dev = dev_get_by_name(net, dev_name);
>+ dev = netdev_get_by_name(net, dev_name, &b->devtracker, GFP_KERNEL);
> if (!dev)
> return -ENODEV;
> if (tipc_mtu_bad(dev)) {
>- dev_put(dev);
>+ netdev_put(dev, &b->devtracker);
> return -EINVAL;
> }
> if (dev == net->loopback_dev) {
>- dev_put(dev);
>+ netdev_put(dev, &b->devtracker);
Loopback device is using tn->loopback_pt.dev_tracker, not b->devtracker.
Did you try to configure bearer on a net namespace to test if your patch works ?
Powered by blists - more mailing lists