]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: clear DIFLAG2_NREXT64 when filesystem doesn't support nrext64
authorDarrick J. Wong <djwong@kernel.org>
Tue, 12 Jul 2022 18:26:33 +0000 (13:26 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 12 Jul 2022 18:26:33 +0000 (13:26 -0500)
Clear the nrext64 inode flag if the filesystem doesn't have the nrext64
feature enabled in the superblock.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/dinode.c

index 00de31fb127c99eb2e3d98053ee794a739a61044..7610cd45659b50967fdc38a1735073000143abce 100644 (file)
@@ -2690,6 +2690,19 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
                        }
                }
 
+               if (xfs_dinode_has_large_extent_counts(dino) &&
+                   !xfs_has_large_extent_counts(mp)) {
+                       if (!uncertain) {
+                               do_warn(
+       _("inode %" PRIu64 " is marked large extent counts but file system does not support large extent counts\n"),
+                                       lino);
+                       }
+                       flags2 &= ~XFS_DIFLAG2_NREXT64;
+
+                       if (!no_modify)
+                               *dirty = 1;
+               }
+
                if (!verify_mode && flags2 != be64_to_cpu(dino->di_flags2)) {
                        if (!no_modify) {
                                do_warn(_("fixing bad flags2.\n"));