From: Johan Hovold <johan@kernel.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] gpio: sysfs: add missing mutex_destroy()
Date: Mon, 19 May 2025 14:42:34 +0200 [thread overview]
Message-ID: <aCsnOthU3z1jwWdb@hovoldconsulting.com> (raw)
In-Reply-To: <CAMRc=MdS0QG_ThYUhwTRaKidyGcj3h6x0=jmaW7UK8EBPhrYrw@mail.gmail.com>
On Mon, May 19, 2025 at 02:18:15PM +0200, Bartosz Golaszewski wrote:
> On Fri, May 16, 2025 at 6:58 PM Johan Hovold <johan@kernel.org> wrote:
> > On Fri, May 16, 2025 at 02:32:54PM +0200, Bartosz Golaszewski wrote:
> > > On Fri, May 16, 2025 at 1:42 PM Johan Hovold <johan@kernel.org> wrote:
> > > > On Fri, May 16, 2025 at 12:40:23PM +0200, Bartosz Golaszewski wrote:
> > > > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > > >
> > > > > We initialize the data->mutex in gpiod_export() but lack the
> > > > > corresponding mutex_destroy() in gpiod_unexport() causing a resource
> > > > > leak with mutex debugging enabled. Add the call right before kfreeing
> > > > > the GPIO data.
> > > >
> > > > No, there's no resource leak and it's perfectly fine not to call
> > > > mutex_destroy().
> > >
> > > No, there's no leak but with lock debugging it still warns if the
> > > mutex is locked when it's being destroyed so the change still makes
> > > sense with a modified commit message.
> > >
> > > > You can't just make shit up and then pretend to fix it...
> > >
> > > There's no need for this kind of comment. You made your point clear in
> > > the first sentence.
> >
> > Your claim that there's "a resource leak with mutex debugging enabled"
> > is is quite specific. Now I had to go check that no one had changed
> > something in ways they shouldn't have recently. But mutex_destroy()
> > still works as it always has, which you should have verified yourself
> > before sending a "fix" tagged for stable backport based on a hunch.
>
> Yes, I admitted that the commit message was wrong. And yes, it
> sometimes happens that we get copied on crappy patches. However,
> unlike what your comment suggests, I don't go around the kernel,
> "making sh*t up" just to add a "Fixes: Johan's commit". I had this as
> part of a bigger rework I have in progress[1] (discussed previously
> here[2]) and figured that with the series growing in size, I'll at
> least get the fix upstream before v6.16-rc1.
But it is not a fix. It is based on a misunderstanding that you should
have caught yourself by just looking at the code before posting.
Sure, mutex_destroy() is an odd bird, but you still need to verify your
guesses before posting patches based on them. It's that lazy attitude
(and violation of the stable kernel policy) that I'm criticising.
Johan
next prev parent reply other threads:[~2025-05-19 12:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 10:40 [PATCH] gpio: sysfs: add missing mutex_destroy() Bartosz Golaszewski
2025-05-16 11:42 ` Johan Hovold
2025-05-16 12:32 ` Bartosz Golaszewski
2025-05-16 16:58 ` Johan Hovold
2025-05-19 12:18 ` Bartosz Golaszewski
2025-05-19 12:42 ` Johan Hovold [this message]
2025-05-19 12:50 ` Bartosz Golaszewski
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=aCsnOthU3z1jwWdb@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox