[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250604134347.GH7758@google.com>
Date: Wed, 4 Jun 2025 14:43:47 +0100
From: Lee Jones <lee@...nel.org>
To: David Laight <david.laight.linux@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Christian Brauner <brauner@...nel.org>,
Kuniyuki Iwashima <kuniyu@...zon.com>,
Alexander Mikhalitsyn <aleksandr.mikhalitsyn@...onical.com>,
Jens Axboe <axboe@...nel.dk>, Sasha Levin <sashal@...nel.org>,
Michal Luczaj <mhal@...x.co>, Rao Shoaib <Rao.Shoaib@...cle.com>,
Simon Horman <horms@...nel.org>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v6.1 05/27] af_unix: Replace BUG_ON() with WARN_ON_ONCE().
On Fri, 23 May 2025, David Laight wrote:
> On Wed, 21 May 2025 16:27:04 +0100
> Lee Jones <lee@...nel.org> wrote:
>
> > From: Kuniyuki Iwashima <kuniyu@...zon.com>
> >
> > [ Upstream commit d0f6dc26346863e1f4a23117f5468614e54df064 ]
> >
> > This is a prep patch for the last patch in this series so that
> > checkpatch will not warn about BUG_ON().
>
> Does any of this actually make any sense?
> Either the BUG_ON() should be just deleted because it can't happen
> (or doesn't matter) or there should be an error path.
> Blindly replacing with WARN_ON_ONCE() can't be right.
>
> The last change (repeated here)
> > if (u) {
> > - BUG_ON(!u->inflight);
> > - BUG_ON(list_empty(&u->link));
> > + WARN_ON_ONCE(!u->inflight);
> > + WARN_ON_ONCE(list_empty(&u->link));
> >
> > u->inflight--;
> > if (!u->inflight)
> is clearly just plain wrong.
> If 'inflight' is zero then 'decrementing' it to ~0 is just going
> to 'crash and burn' very badly not much later on.
All of this gets removed in patch 20, so I fear the point is moot.
--
Lee Jones [李琼斯]
Powered by blists - more mailing lists