xfs: actually rebuild the parent pointer xattrs
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 16:48:16 +0000 (09:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 23 Apr 2024 23:55:15 +0000 (16:55 -0700)
commita26dc21309af68623b82b4e366cbbeb5a85ce65b
tree3703a8518aa178121f79c5762e91354ff6703169
parent6efbbdeb140603351e1413aee79e789bf2279a2b
xfs: actually rebuild the parent pointer xattrs

Once we've assembled all the parent pointers for a file, we need to
commit the new dataset atomically to that file.  Parent pointer records
are embedded in the xattr structure, which means that we must write a
new extended attribute structure, again, atomically.  Therefore, we must
copy the non-parent-pointer attributes from the file being repaired into
the temporary file's extended attributes and then call the atomic extent
swap mechanism to exchange the blocks.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_attr.h
fs/xfs/scrub/attr_repair.c
fs/xfs/scrub/attr_repair.h
fs/xfs/scrub/findparent.c
fs/xfs/scrub/parent_repair.c
fs/xfs/scrub/trace.h