Index | Thread | Search

From:
Rafael Sadowski <rafael@sizeofvoid.org>
Subject:
Re: Remove inconsistent NULL check in ffs_realloccg
To:
Theo Buehler <tb@theobuehler.org>
Cc:
tech@openbsd.org
Date:
Sun, 21 Sep 2025 17:36:18 +0200

Download raw body.

Thread
On Fri Sep 19, 2025 at 11:17:53PM +0200, Theo Buehler wrote:
> On Fri, Sep 19, 2025 at 10:30:35PM +0200, Rafael Sadowski wrote:
> > ffs_realloccg()  always sets *bpp to  NULL at the start, so checking bpp
> > != NULL later is unnecessary. Remove the useless check.
> 
> This doesn't look right. I don't know much about ffs interna but...
> 
> Currently a caller can do ffs_realloccg(..., NULL, blknop) if it doesn't
> care about the bpp or it can do ffs_realloccg(..., &bp, blocknop) with
> an uninitialized struct buf *bp and the function will initialize it
> whether it succeeds or not. Your diff breaks callers of the first kind.
> 

You're absolutely correct. This change breaks the API. Although we
never call ffs_realloccg with NULL but the commit is not worth it.