From: Jason Gunthorpe <jgg@ziepe.ca>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Bernard Metzler <bmt@zurich.ibm.com>,
Leon Romanovsky <leon@kernel.org>,
Ursula Braun <ubraun@linux.ibm.com>,
OFED mailing list <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH] RDMA: don't ignore client->add() failures
Date: Wed, 29 Mar 2023 12:44:37 -0300 [thread overview]
Message-ID: <ZCRc5S9QGZqcZhNg@ziepe.ca> (raw)
In-Reply-To: <d2dfb901-50b1-8e34-8217-d29e63f421c7@I-love.SAKURA.ne.jp>
On Wed, Mar 29, 2023 at 07:17:26AM +0900, Tetsuo Handa wrote:
> On 2023/03/29 1:18, Jason Gunthorpe wrote:
> > On Tue, Mar 28, 2023 at 11:59:48PM +0900, Tetsuo Handa wrote:
> >> Without this patch, __ib_unregister_device(device) is not called because
> >> enable_device_and_get() returns 0 because add_client_context() returns 0
> >> because add_client_context() ignores client->add() failures. As a result,
> >> device's refcount remains 7, which later prevents unregister_netdevice()
> >> from unregistering this device.
> >
> > That is completely correct, the device was successfully registered
> > without one of the clients.
>
> ib_register_device() is responsible for unregistering that device (by calling
> __ib_unregister_device(device)) if ib_register_device() failed to
> initialize a device, isn't it?
Yes, if it fails. It isn't returning a failure code, so of course it
doesn't fail.
You changed this code and forced it to always fail, so of course it
radically changes everything about the bug you are looking at.
> The caller of ib_register_device() (i.e. siw_device_register() from
> siw_newlink()) is assuming that somebody will call __ib_unregister_device(),
> but nobody is calling __ib_unregister_device().
On the success path this stuff happens during dellink
Jason
next prev parent reply other threads:[~2023-03-29 15:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 10:52 [PATCH] RDMA: don't ignore client->add() failures Tetsuo Handa
2023-03-28 11:24 ` Jason Gunthorpe
2023-03-28 11:33 ` Tetsuo Handa
2023-03-28 11:34 ` Jason Gunthorpe
2023-03-28 14:59 ` Tetsuo Handa
2023-03-28 16:18 ` Jason Gunthorpe
2023-03-28 22:17 ` Tetsuo Handa
2023-03-29 15:44 ` Jason Gunthorpe [this message]
2023-03-29 23:51 ` Tetsuo Handa
2023-03-30 23:39 ` Jason Gunthorpe
2023-03-31 16:19 ` Tetsuo Handa
2023-03-31 16:23 ` Jason Gunthorpe
2023-04-01 7:30 ` Tetsuo Handa
2023-04-01 18:30 ` Leon Romanovsky
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=ZCRc5S9QGZqcZhNg@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=bmt@zurich.ibm.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=ubraun@linux.ibm.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