]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_repair: allow CoW staging extents in the realtime rmap records
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:22:33 +0000 (14:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 9 Jul 2024 22:37:24 +0000 (15:37 -0700)
Don't flag the rt rmap btree as having errors if there are CoW staging
extent records in it and the filesystem supports.  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>
repair/scan.c

index 6b278d1f98fbd2f30e85d8818bbf838746c717c6..8bef93c4d36eaf11c519e324c67fde6a923a728b 100644 (file)
@@ -1416,9 +1416,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);