Re: [syzbot] [mm?] WARNING in mas_nomem

From: Jason Gunthorpe

Date: Fri Aug 07 2026 - 15:26:46 EST


On Fri, Aug 07, 2026 at 03:24:24PM -0400, Liam R. Howlett wrote:
> On 26/08/07 09:19AM, Liam R. Howlett wrote:
> > On 26/08/06 12:48PM, Jason Gunthorpe wrote:
> > > On Thu, Aug 06, 2026 at 10:29:27AM -0400, Liam R. Howlett wrote:
> > >
> > > > @@ -5609,8 +5612,7 @@ void *mas_store(struct ma_state *mas, void *entry)
> > > > goto store;
> > > >
> > > > mas_alloc_nodes(mas, GFP_NOWAIT);
> > > > - if (mas_is_err(mas))
> > > > - return NULL;
> > > > + mas_nomem(mas, GFP_KERNEL | __GFP_NOFAIL);
> > >
> > > It still feels really weird to ignore the return code from mas_nomem..
> > >
> > > void mas_nomem_nofail()
> >
> > Sure, that's fair.
> >
> > >
> > > ? and maybe it can have a WARN_ON
> >
> >
> > The warning would never trigger. If the allocation fails with nofail,
> > then you'd never reach the warning.
>
> Upon rereading my reply, I don't think it was clear what's going to
> happen here.
>
> If there's really no memory and no reserves, then we're going to panic
> on trying to allocate. So, even if I rewrite this to have a void
> function to print a warning, it will never trigger, at that point why
> have another function? Are you looking to document what's happening in
> the code with this? If so, maybe a comment would be better.

Yeah, it is clearer to document it with a function that can't be
called wrong, IMHO

Jason