Re: [PATCH 4/5] xfs_repair: skip the rmap and refcount btree checks when the levels are garbage

Christoph Hellwig
2020-10-28T21:52:31Z

On Mon, Oct 26, 2020 at 04:32:18PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> In validate_ag[fi], we should check that the levels of the rmap and
> refcount btrees are valid. If they aren't, we need to tell phase4 to
> skip the comparison between the existing and incore rmap and refcount
> data. The comparison routines use libxfs btree cursors, which assume
> that the caller validated bc_nlevels and will corrupt memory if we load
> a btree cursor with a garbage level count.
>
> This was found by examing a core dump from a failed xfs/086 invocation.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

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