Re: [PATCH 2/8] xfs: refactor the inode fork memory allocation functions

Darrick J. Wong
2024-12-17T19:44:00Z

On Thu, Dec 12, 2024 at 10:05:28PM -0800, Christoph Hellwig wrote:
> On Thu, Dec 12, 2024 at 04:58:30PM -0800, Darrick J. Wong wrote:
> > - ifp->if_broot = kmalloc(size,
> > - GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL);
> > - ASSERT(ifp->if_broot != NULL);
> > + broot = xfs_broot_alloc(ifp, size);
> > + ASSERT(broot != NULL);
>
> Maybe use the chance to drop this somewhat silly assert? If a NOFAIL
> allocation fails we're in deep trouble, and the NULL pointer dereference
> a bit below will catch it anyway.

Will do. Thanks for reviewing!

--D

> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
>