From: Leon Romanovsky <leon@kernel.org>
To: David Ahern <dsahern@kernel.org>
Cc: linux-rdma@vger.kernel.org, jgg@ziepe.ca
Subject: Re: [PATCH] RDMA: Fix netdev tracker in ib_device_set_netdev
Date: Thu, 11 Jul 2024 13:09:44 +0300 [thread overview]
Message-ID: <20240711100944.GO6668@unreal> (raw)
In-Reply-To: <4f38320c-22e4-403e-8d68-ce04e504cedc@kernel.org>
On Wed, Jul 10, 2024 at 10:59:15AM -0700, David Ahern wrote:
> On 7/10/24 12:09 AM, Leon Romanovsky wrote:
> >> diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> >> index 55aa7aa32d4a..7ddaec923569 100644
> >> --- a/drivers/infiniband/core/device.c
> >> +++ b/drivers/infiniband/core/device.c
> >> @@ -2167,7 +2167,7 @@ int ib_device_set_netdev(struct ib_device *ib_dev, struct net_device *ndev,
> >> }
> >>
> >> if (old_ndev)
> >> - netdev_tracker_free(ndev, &pdata->netdev_tracker);
> >> + netdev_put(old_ndev, &pdata->netdev_tracker);
> >
> > It should stay netdev_tracker_free() and not netdev_put(). We are
> > calling to __dev_put(old_ndev) later in the function.
> >
>
> missed that and KASAN and refcount debugging did not complain ...
>
> Anyways, why have the 2 split apart? ie., why not remove the __dev_put
> and just do netdev_put here? old_ndev is not needed in between calls.
> Asymmetric calls like this are always confusing.
You probably can combine them, but to do so instead of __dev_put() and
not netdev_tracker_free().
Thanks
next prev parent reply other threads:[~2024-07-11 10:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 21:44 [PATCH] RDMA: Fix netdev tracker in ib_device_set_netdev David Ahern
2024-07-10 6:09 ` Leon Romanovsky
2024-07-10 17:59 ` David Ahern
2024-07-11 10:09 ` Leon Romanovsky [this message]
2024-07-11 19:50 ` Jason Gunthorpe
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=20240711100944.GO6668@unreal \
--to=leon@kernel.org \
--cc=dsahern@kernel.org \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.