]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: add per-AG btree blocks to rmap data and add to rmapbt
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 19 Aug 2016 00:51:24 +0000 (10:51 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 19 Aug 2016 00:51:24 +0000 (10:51 +1000)
commit62cf990a612c76a73f0676795d4223b7ceb8f318
tree91a38420d9bbaa107a592f8e2247affed61281c4
parent934b554845efe77615bfb346d1c0bd9a3a865441
xfs_repair: add per-AG btree blocks to rmap data and add to rmapbt

Since we can't know the location of the new per-AG btree blocks prior
to constructing the rmapbt, we must record raw reverse-mapping data for
btree blocks while the new btrees are under construction.  After the
rmapbt has been rebuilt, merge the btree rmap entries into the rmapbt
with the libxfs code.

Also refactor the freelist fixing code since we need it to tidy up
the AGFL after each rmapbt allocation.

Use libxfs_rmap_alloc to add rmap records for AG metadata blocks
because it knows how to merge adjacent rmaps.  This particular bug was
discovered while running xfs_repair twice on generic/175 wherein block
X was originally allocated to the rmapbt, then X+1 got allocated to
the rmapbt when we expanded it to hold all the entries for the rmapbt
blocks.

[dchinner: libxfs'ify the libxfs calls.]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/libxfs_api_defs.h
repair/phase5.c
repair/rmap.c
repair/rmap.h