[PATCH 14/21] Fix free/alloc reversal of btree block merge condition
Valerie Aurora
val at versity.com
Wed Feb 19 05:04:11 PST 2025
On Fri, Feb 14, 2025 at 9:20 PM Zach Brown <zab at zabbo.net> wrote:
>
> On Tue, Feb 11, 2025 at 10:19:11PM +0100, Valerie Aurora wrote:
> > memmove_item_headers(tblk, bt, ind, 1);
> > ngnfs_tblk_le16_add_cpu(tblk, &bt->tail_free, -bytes);
> > + BUG_ON(le16_to_cpu(bt->tail_free) > NGNFS_BTREE_MAX_FREE);
> > ngnfs_tblk_le16_add_cpu(tblk, &bt->total_free, -bytes);
> > + BUG_ON(le16_to_cpu(bt->total_free) > NGNFS_BTREE_MAX_FREE);
>
> But this drove me a little bonkers. Let's not sprinkle these amongst
> the block changes.
>
> If we're going to have these assertions, let's put them up at the
> opening of the function that'd be verifying the caller's promises.
> insert_item had the start of that. delete_item didn't but could.
>
> I figured you'd want to tweak this instead of having my mangle the patch
> -- but I'm happy to throw it together if you'd rather not. Whatever's
> easiest!
Makes sense, thanks for flagging it and explaining why! I'll include
the updated version in the next set, coming shortly.
Valerie
More information about the ngnfs-devel
mailing list