[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJfpegsJigpXwhc35KZH4LOihjinz7e0OCBPT5fLHkio1GGkfw@mail.gmail.com>
Date: Thu, 4 Sep 2025 10:40:39 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Luis Henriques <luis@...lia.com>
Cc: Joanne Koong <joannelkoong@...il.com>, "Darrick J. Wong" <djwong@...nel.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-dev@...lia.com
Subject: Re: [PATCH v2] fuse: prevent possible NULL pointer dereference in fuse_iomap_writeback_{range,submit}()
On Thu, 4 Sept 2025 at 10:24, Luis Henriques <luis@...lia.com> wrote:
> I don't have a preference between v1 and v2 of this patch. v1 removed the
> WARNs because I don't think they are useful:
>
> 1. the assertions are never true, but
> 2. if they are, they are useless because we'll hit a NULL pointer
> dereference anyway.
>
> v2 tries to fix the code assuming the assertions can be triggered.
>
> So, yeah I'll just leave the 3 options (v1, v2, or do nothing) on the
> table :-)
WARN_ON is a useful tool to document interface constrains. But so is
dereferencing of a pointer.
V2 style WARN_ON should only be used if it's difficult to prove that
the condition will evaluate to false and we don't want the kernel to
crash in some unknown corner case. AFAICS it is not the case here, so
I'd opt for v1.
Thanks,
Miklos
Powered by blists - more mailing lists