Re: [PATCH] netdevsim: fix deadlock in nsim_bus_dev_max_vfs_write()

From: Slawomir Stepien

Date: Fri Aug 07 2026 - 03:31:51 EST


On sie 05, 2026 16:08, Jakub Kicinski wrote:
> On Fri, 31 Jul 2026 09:55:04 +0000 (UTC) syzbot wrote:
> > --- a/drivers/net/netdevsim/dev.c
> > +++ b/drivers/net/netdevsim/dev.c
> > @@ -273,7 +273,11 @@ static ssize_t nsim_bus_dev_max_vfs_write(struct file *file,
>
> Sorry to chime in poniewczasie.
> Please delete this file. netdevsim is a harness for in-tree selftests,
> none seems to be reading or writing the debugfs num_vfs AFAICT
> so let's just drop it?

That's true, but is netdevsim used *just* by the selftests (or was designed with only selftests in
mind)? What if someone is using it without selftests?

On the other hand: what sashiko found:
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/b7bf56ea-7522-4163-acd5-aaa69ad03b3a%40mail.kernel.org
is true: the same issue will be with e.g. break_health. So it seems to me that a better approach
would be to change when the debugfs files are removed.

It seems to me that change in nsim_drv_remove() might be easy, but what about
nsim_dev_reload_down()...it seems it will have the same deadlock. Or am I missing something for this
case?

--
Slawomir Stepien