[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iK0n6yNR+Bgj_rWqz=sYcp2nLVFOE_G0UXppL5KxHSUdA@mail.gmail.com>
Date: Fri, 4 Feb 2022 14:24:13 -0800
From: Eric Dumazet <edumazet@...gle.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 0/3] net: device tracking improvements
On Fri, Feb 4, 2022 at 1:51 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Fri, Feb 4, 2022 at 10:36 AM Eric Dumazet <eric.dumazet@...il.com> wrote:
> >
> > From: Eric Dumazet <edumazet@...gle.com>
> >
> > Main goal of this series is to be able to detect the following case
> > which apparently is still haunting us.
> >
> > dev_hold_track(dev, tracker_1, GFP_ATOMIC);
> > dev_hold(dev);
> > dev_put(dev);
> > dev_put(dev); // Should complain loudly here.
> > dev_put_track(dev, tracker_1); // instead of here (as before this series)
>
>
> Please do not merge.
>
> I have missed some warnings in my tests, it seems I need to refine
> things a bit more.
I had to add the following on top of the last patch, I will send a V2 soon.
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index b0f5344d1185be66d05cd1dc50cffc5ccfe883ef..95098d1a49bdf4cbc3ddeb4d345e4276f974a208
100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -166,10 +166,10 @@ static void linkwatch_do_dev(struct net_device *dev)
netdev_state_change(dev);
}
- /* Note: our callers are responsible for
- * calling netdev_tracker_free().
+ /* Note: our callers are responsible for calling netdev_tracker_free().
+ * This is the reason we use __dev_put() instead of dev_put().
*/
- dev_put(dev);
+ __dev_put(dev);
}
static void __linkwatch_run_queue(int urgent_only)
Powered by blists - more mailing lists