[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAvyFNj3QBka0fS5DNLqYDXxAWxduBrkWp991yC6J_3JZa5H2w@mail.gmail.com>
Date: Fri, 9 Aug 2024 16:13:45 +1000
From: Jamie Bainbridge <jamie.bainbridge@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Johannes Berg <johannes@...solutions.net>,
Shigeru Yoshida <syoshida@...hat.com>, Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v4] net-sysfs: check device is present when showing duplex
On Fri, 9 Aug 2024 at 01:10, Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Tue, 6 Aug 2024 16:35:27 +1000 Jamie Bainbridge wrote:
> > A sysfs reader can race with a device reset or removal, attempting to
> > read device state when the device is not actually present.
>
> True, but..
>
> > - if (netif_running(netdev)) {
> > + if (netif_running(netdev) && netif_device_present(netdev)) {
> > struct ethtool_link_ksettings cmd;
> >
> > if (!__ethtool_get_link_ksettings(netdev, &cmd)) {
>
> ..there are more callers of __ethtool_get_link_ksettings() and only
> a fraction of them have something resembling a presence check in
> their path. Can we put the check inside __ethtool_get_link_ksettings()
> itself?
No worries. iiuc that would also mean reverting commit 4224cfd7fb65
("net-sysfs: add check for netdevice being present to speed_show")
because the check is being centralised. Should I do that in the same
patch, or a separate revert patch?
Powered by blists - more mailing lists