]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: always check realtime file mappings against incore info
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:22:01 +0000 (10:22 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:16:01 +0000 (09:16 -0800)
commit400985de9be0b237e245379675df72ad64f68fb6
treec52c62d2fea0c7547f655be53751eb259df10311
parent3cf4b2e166bd684f73e51c0c6d6c14c089b56504
xfs_repair: always check realtime file mappings against incore info

Curiously, the xfs_repair code that processes data fork mappings of
realtime files doesn't actually compare the mappings against the incore
state map during the !check_dups phase (aka phase 3).  As a result, we
lose the opportunity to clear damaged realtime data forks before we get
to crosslinked file checking in phase 4, which results in ondisk
metadata errors calling do_error, which aborts repair.

Split the process_rt_rec_state code into two functions: one to check the
mapping, and another to update the incore state.  The first one can be
called to help us decide if we're going to zap the fork, and the second
one updates the incore state if we decide to keep the fork.  We already
do this for regular data files.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/dinode.c