xfs: inode repair should ensure there's an attr fork to store parent pointers
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 16:48:19 +0000 (09:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 23 Apr 2024 23:55:16 +0000 (16:55 -0700)
commit327ed702d84034879572812f580cb769848af7ae
treea74395760fb6bfc2722dd85cd4258734044bcf8c
parent3f50ddbf4b470f8566f99a83597da50180d937c0
xfs: inode repair should ensure there's an attr fork to store parent pointers

The runtime parent pointer update code expects that any file being moved
around the directory tree already has an attr fork.  However, if we had
to rebuild an inode core record, there's a chance that we zeroed forkoff
as part of the inode to pass the iget verifiers.

Therefore, if we performed any repairs on an inode core, ensure that the
inode has a nonzero forkoff before unlocking the inode.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/inode_repair.c