maple_tree: make mas_validate_gaps() to check metadata
authorPeng Zhang <zhangpeng.00@bytedance.com>
Tue, 11 Jul 2023 03:54:39 +0000 (11:54 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Aug 2023 17:12:21 +0000 (10:12 -0700)
commitf8e5eac8abe3d26106e5470c735058f04f60f61e
treef1776d1abd44db5e7096b52707e1bd0cbd6c183b
parentd695c30a8ca07ac7e2138435b461b36289d5656e
maple_tree: make mas_validate_gaps() to check metadata

Make mas_validate_gaps() check whether the offset in the metadata points
to the largest gap.  By the way, simplify this function.

Add the verification that gaps beyond the node limit are zero.

Link: https://lkml.kernel.org/r/20230711035444.526-4-zhangpeng.00@bytedance.com
Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c