From: Darrick J. Wong Date: Tue, 9 Jan 2024 17:42:00 +0000 (-0800) Subject: xfs: actually rebuild the parent pointer xattrs X-Git-Tag: xfs-zoned-old-2024-06-10~334 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8dc403353ec915a1fd9c78b0586b89d72c12e883;p=users%2Fhch%2Fxfsprogs.git 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 --- diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index b29c911dd..a0b8f3b02 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -949,7 +949,7 @@ xfs_attr_lookup( return error; } -STATIC int +int xfs_attr_add_fork( struct xfs_inode *ip, /* incore inode pointer */ int size, /* space new attribute needs */ diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index d51001c58..2a0ef4f63 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -643,5 +643,6 @@ int __init xfs_attr_intent_init_cache(void); void xfs_attr_intent_destroy_cache(void); int xfs_attr_sf_totsize(struct xfs_inode *dp); +int xfs_attr_add_fork(struct xfs_inode *ip, int size, int rsvd); #endif /* __XFS_ATTR_H__ */