public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Faicker Mo <faicker.mo@zenlayer.com>
Cc: "sridhar.samudrala@intel.com" <sridhar.samudrala@intel.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"sdf@fomichev.me" <sdf@fomichev.me>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: net_failover: Fix the deadlock in slave register
Date: Sun, 26 Apr 2026 09:10:49 +0100	[thread overview]
Message-ID: <20260426081049.GM900403@horms.kernel.org> (raw)
In-Reply-To: <PH0PR20MB435271FE3258110CE77261BBFA2A2@PH0PR20MB4352.namprd20.prod.outlook.com>

On Thu, Apr 23, 2026 at 07:59:43AM +0000, Faicker Mo wrote:
> There is netdev_lock_ops() before the NETDEV_REGISTER notifier
> in register_netdevice(), so use the non-locking functions
> in net_failover_slave_register().
> 
> Call Trace:
>  <TASK>
>  __schedule+0x30d/0x7a0
>  schedule+0x27/0x90
>  schedule_preempt_disabled+0x15/0x30
>  __mutex_lock.constprop.0+0x538/0x9e0
>  __mutex_lock_slowpath+0x13/0x20
>  mutex_lock+0x3b/0x50
>  dev_set_mtu+0x40/0xe0
>  net_failover_slave_register+0x24/0x280
>  failover_slave_register+0x103/0x1b0
>  failover_event+0x15e/0x210
>  ? dropmon_net_event+0xac/0xe0
>  notifier_call_chain+0x5e/0xe0
>  raw_notifier_call_chain+0x16/0x30
>  call_netdevice_notifiers_info+0x52/0xa0
>  register_netdevice+0x5f4/0x7c0
>  register_netdev+0x1e/0x40
>  _mlx5e_probe+0xe2/0x370 [mlx5_core]
>  mlx5e_probe+0x59/0x70 [mlx5_core]
>  ? __pfx_mlx5e_probe+0x10/0x10 [mlx5_core]
> 
> Fixes: 4c975fd70002 ("net: hold instance lock during NETDEV_REGISTER/UP")
> Signed-off-by: Faicker Mo <faicker.mo@zenlayer.com>

...

Unfortunately this patch does not apply: it seems that somehow all the tabs
were converted into spaces.

> @@ -565,7 +565,7 @@ static int net_failover_slave_register(struct net_device *slave_dev,
>         dev_close(slave_dev);

Claude Code flags that that this needs to be changed to netif_close()

>  err_dev_open:
>         dev_put(slave_dev);
> -       dev_set_mtu(slave_dev, orig_mtu);
> +       netif_set_mtu(slave_dev, orig_mtu);
>  done:
>         return err;
>  }

-- 
pw-bot: changes-requested

      reply	other threads:[~2026-04-26  8:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23  7:59 [PATCH] net: net_failover: Fix the deadlock in slave register Faicker Mo
2026-04-26  8:10 ` Simon Horman [this message]

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=20260426081049.GM900403@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=faicker.mo@zenlayer.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=sridhar.samudrala@intel.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