]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: actually rebuild the parent pointer xattrs
authorDarrick J. Wong <djwong@kernel.org>
Mon, 29 Jul 2024 23:22:52 +0000 (16:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:03 +0000 (17:01 -0700)
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 <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_attr.c
libxfs/xfs_attr.h

index f94e7487969a6b3a20e279395ee0884e22f53dba..52fcb1c4c939757f4e27104a000ae0c7fdd4d32d 100644 (file)
@@ -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 */
index 43dee4cbaab2515cb5207b53651fcdee00bcad41..088cb7b301680ca024d58cf2ca8d7bbdc5a4ef8d 100644 (file)
@@ -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__ */