xfs: log EFIs for all btree blocks being used to stage a btree
authorDarrick J. Wong <djwong@kernel.org>
Thu, 7 Dec 2023 02:41:00 +0000 (18:41 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 7 Dec 2023 02:45:19 +0000 (18:45 -0800)
commit6bb9ea8ecd2c58a66324cb799838e7d49d78a877
treeaae2cea04fa5f8d1a440d86f42979806e932ba86
parentbe408417630427984a1fddd069f30b245793234c
xfs: log EFIs for all btree blocks being used to stage a btree

We need to log EFIs for every extent that we allocate for the purpose of
staging a new btree so that if we fail then the blocks will be freed
during log recovery.  Use the autoreaping mechanism provided by the
previous patch to attach paused freeing work to the scrub transaction.
We can then mark the EFIs stale if we decide to commit the new btree, or
we can unpause the EFIs if we decide to abort the repair.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/newbt.c
fs/xfs/scrub/newbt.h