From: Darrick J. Wong Date: Fri, 10 Jul 2020 19:35:45 +0000 (-0400) Subject: xfs_repair: mark entire free space btree record as free1 X-Git-Tag: xfsprogs-5.7-fixes_2020-07-14~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15fd0ca2c1af9288406acefafdd426ac12868c62;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: mark entire free space btree record as free1 In scan_allocbt, we iterate each free space btree record (of both bnobt and cntbt) in the hopes of pushing all the free space from UNKNOWN to FREE1 to FREE. Unfortunately, the first time we see a free space record we only set the first block of that record to FREE1, which means that the second time we see the record, the first block will get set to FREE, but the rest of the free space will only make it to FREE1. This is incorrect state, so we need to fix that. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/repair/scan.c b/repair/scan.c index 760792477..505cfc533 100644 --- a/repair/scan.c +++ b/repair/scan.c @@ -719,7 +719,7 @@ _("%s freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"), state = get_bmap_ext(agno, b, end, &blen); switch (state) { case XR_E_UNKNOWN: - set_bmap(agno, b, XR_E_FREE1); + set_bmap_ext(agno, b, blen, XR_E_FREE1); break; case XR_E_FREE1: /*