Signed-off-by: Stefan Ring <stefanrin@xxxxxxxxx> Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- db/metadump.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/db/metadump.c b/db/metadump.c index edc288ce..3994c4f4 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -2176,6 +2176,19 @@ process_btinode( } pp = XFS_BMDR_PTR_ADDR(dib, 1, maxrecs); + + if (zero_stale_data) { + char *top; + + /* Unused btree key space */ + top = (char*)XFS_BMDR_KEY_ADDR(dib, nrecs + 1); + memset(top, 0, (char*)pp - top); + + /* Unused btree ptr space */ + top = (char*)&pp[nrecs]; + memset(top, 0, (char*)dib + XFS_DFORK_SIZE(dip, mp, whichfork) - top); + } + for (i = 0; i < nrecs; i++) { xfs_agnumber_t ag; xfs_agblock_t bno; -- 2.19.2