]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: inject lost blocks back into the fs no matter the owner
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 10 Jul 2020 19:35:45 +0000 (15:35 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 10 Jul 2020 19:35:45 +0000 (15:35 -0400)
In repair phase 5, inject_lost_blocks takes the blocks that we allocated
but didn't use for constructing the new AG btrees and puts them back in
the filesystem by adding them to the free space.  The only btree that
can overestimate like that are the free space btrees, but in principle,
any of the btrees can do that.  If the others did, the rmap record owner
for those blocks won't necessarily be OWNER_AG, and if it isn't, repair
will fail.

Get rid of this logic bomb so that we can use it for /any/ block count
overestimation, and then we can use it to clean up after all
reconstruction of any btree type.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase5.c

index ae83ee8af5d88184424e92c62aefd0c00444601f..454683c42e4856828818f89bc77ecb83cc55c4d6 100644 (file)
@@ -2490,8 +2490,8 @@ inject_lost_blocks(
                if (error)
                        goto out_cancel;
 
-               error = -libxfs_free_extent(tp, *fsb, 1, &XFS_RMAP_OINFO_AG,
-                                           XFS_AG_RESV_NONE);
+               error = -libxfs_free_extent(tp, *fsb, 1,
+                               &XFS_RMAP_OINFO_ANY_OWNER, XFS_AG_RESV_NONE);
                if (error)
                        goto out_cancel;