]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: allow realtime files to have the reflink flag set
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:22:06 +0000 (10:22 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:16:02 +0000 (09:16 -0800)
Now that we allow reflink on the realtime volume, allow that combination
of inode flags if the feature's enabled.  Note that we now allow inodes
to have rtinherit even if there's no realtime volume, since the kernel
has never restricted that.

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

index f49c735d34356b4bb0a105791d96669d7f195158..5a1c8e8cb3ec113d466b74a8ec5f216df8d45d1d 100644 (file)
@@ -3356,7 +3356,8 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
                }
 
                if ((flags2 & XFS_DIFLAG2_REFLINK) &&
-                   (flags & (XFS_DIFLAG_REALTIME | XFS_DIFLAG_RTINHERIT))) {
+                   !xfs_has_rtreflink(mp) &&
+                   (flags & XFS_DIFLAG_REALTIME)) {
                        if (!uncertain) {
                                do_warn(
        _("Cannot have a reflinked realtime inode %" PRIu64 "\n"),
@@ -3388,7 +3389,8 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
                }
 
                if ((flags2 & XFS_DIFLAG2_COWEXTSIZE) &&
-                   (flags & (XFS_DIFLAG_REALTIME | XFS_DIFLAG_RTINHERIT))) {
+                   !xfs_has_rtreflink(mp) &&
+                   (flags & XFS_DIFLAG_REALTIME)) {
                        if (!uncertain) {
                                do_warn(
        _("Cannot have CoW extent size hint on a realtime inode %" PRIu64 "\n"),