From: Darrick J. Wong Date: Mon, 29 Jul 2024 23:22:52 +0000 (-0700) Subject: xfs: actually rebuild the parent pointer xattrs X-Git-Tag: v6.10.0~24^2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e6ede97edd07e908a79c8afea42714fb348f954;p=thirdparty%2Fxfsprogs-dev.git xfs: actually rebuild the parent pointer xattrs Source kernel commit: a26dc21309af68623b82b4e366cbbeb5a85ce65b Once we've assembled all the parent pointers for a file, we need to 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 Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index f94e7487..52fcb1c4 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -947,7 +947,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 43dee4cb..088cb7b3 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -648,5 +648,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__ */