Re: [PATCH] freevxfs: don't BUG() on duplicate OLT entries

From: Christoph Hellwig

Date: Tue May 26 2026 - 02:41:46 EST


On Mon, May 25, 2026 at 06:10:59PM -0700, Farhad Alemi wrote:
> +static inline int
> vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp)
> {
> - BUG_ON(infp->vsi_fshino);
> + if (infp->vsi_fshino)
> + return -EINVAL;
> infp->vsi_fshino = fs32_to_cpu(infp, fshp->olt_fsino[0]);
> + return 0;
> }
>
> -static inline void
> +static inline int
> vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp)
> {
> - BUG_ON(infp->vsi_iext);
> + if (infp->vsi_iext)
> + return -EINVAL;

I'd still keep a WARN_ON_ONCE in the conditional here as this is an
unexpected condition.

> + if (vxfs_get_fshead((struct vxfs_oltfshead *)oaddr, infp))

Overly long line here. Otherwise looks good.

For the next resend please also include Christian Brauner
<christian@xxxxxxxxxx> as he picks up the freevxfs patches through the
VFS tree.