]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: actually rebuild the parent pointer xattrs
authorDarrick J. Wong <djwong@kernel.org>
Tue, 9 Jan 2024 17:42:00 +0000 (09:42 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 10 Apr 2024 00:21:31 +0000 (17:21 -0700)
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>
libxfs/xfs_attr.c
libxfs/xfs_attr.h

index b29c911dd923876483d08b1b4068c66e14ae462c..a0b8f3b02906b54ba560fa27ca2e25c9cec7c7ae 100644 (file)
@@ -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 */
index d51001c5809fef40da900c663c28aa82ac754ad7..2a0ef4f633e2d1cd039197ae1ea153867aab67dc 100644 (file)
@@ -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__ */