]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: allow CoW staging extents in the realtime rmap records
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:22:05 +0000 (10:22 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:16:02 +0000 (09:16 -0800)
Don't flag the rt rmap btree as having errors if there are CoW staging
extent records in it and the filesystem supports reflink.  As far as
reporting leftover staging extents, we'll report them when we scan the
rt refcount btree, in a future patch.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/scan.c

index 7a74f87c5f0c61fe74274ab1656eed59d7eeeff3..7980795e3a6f9f92be8647554ee1f6983d98ba0e 100644 (file)
@@ -1407,9 +1407,20 @@ _("invalid length %llu in record %u of %s\n"),
                        continue;
                }
 
-               /* We only store file data and superblocks in the rtrmap. */
-               if (XFS_RMAP_NON_INODE_OWNER(owner) &&
-                   owner != XFS_RMAP_OWN_FS) {
+               /*
+                * We only store file data, COW data, and superblocks in the
+                * rtrmap.
+                */
+               if (owner == XFS_RMAP_OWN_COW) {
+                       if (!xfs_has_reflink(mp)) {
+                               do_warn(
+_("invalid CoW staging extent in record %u of %s\n"),
+                                               i, name);
+                               suspect++;
+                               continue;
+                       }
+               } else if (XFS_RMAP_NON_INODE_OWNER(owner) &&
+                          owner != XFS_RMAP_OWN_FS) {
                        do_warn(
 _("invalid owner %lld in record %u of %s\n"),
                                (long long int)owner, i, name);