From c83b756da0dac727457022d88d2a0ace30a6dc09 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 2 Jan 2010 12:12:19 +0100 Subject: [PATCH] repair: fix freespace btree record validation MAXEXTLEN is a limit for the bmap btree extent length, not for the freespace btrees which can fill out the whole u32. Remove the check which makes repair skip too large freespace extents. Also add warnings for freespace btree records that fail the remaining validations. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner --- repair/scan.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/repair/scan.c b/repair/scan.c index 5f5743e63..742489438 100644 --- a/repair/scan.c +++ b/repair/scan.c @@ -520,12 +520,18 @@ _("%s freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"), len = be32_to_cpu(rp[i].ar_blockcount); end = b + len; - if (b == 0 || !verify_agbno(mp, agno, b)) - continue; - if (len == 0 || len > MAXEXTLEN) + if (b == 0 || !verify_agbno(mp, agno, b)) { + do_warn( + _("invalid start block %u in record %u of %d btree block %u/%u"), + b, i, name, agno, bno); continue; - if (!verify_agbno(mp, agno, end - 1)) + } + if (len == 0 || !verify_agbno(mp, agno, end - 1)) { + do_warn( + _("invalid length %u in record %u of %d btree block %u/%u"), + len, i, name, agno, bno); continue; + } for ( ; b < end; b += blen) { state = get_bmap_ext(agno, b, end, &blen); -- 2.47.2