xfs: detect unwritten bit set in rmapbt node block keys
authorDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:07 +0000 (19:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:07 +0000 (19:00 -0700)
commit38384569a2a8a721623d80c5ae3bcf80614ab792
treed16b22b95f113c5c5633d120d3ae854cc92ce2d4
parent08c987deca56687c0930f308f5148ef1af38dc14
xfs: detect unwritten bit set in rmapbt node block keys

In the last patch, we changed the rmapbt code to remove the UNWRITTEN
bit when creating an rmapbt key from an rmapbt record, and we changed
the rmapbt key comparison code to start considering the ATTR and BMBT
flags during lookup.  This brought the behavior of the rmapbt
implementation in line with its specification.

However, there may exist filesystems that have the unwritten bit still
set in the rmapbt keys.  We should detect these situations and flag the
rmapbt as one that would benefit from optimization.  Eventually, online
repair will be able to do something in response to this.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/btree.c
fs/xfs/scrub/btree.h
fs/xfs/scrub/rmap.c