From b83b2ec0128ac7a11b50a9ee594d19105c06c579 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 12 Jul 2022 13:26:33 -0500 Subject: [PATCH] xfs_repair: clear DIFLAG2_NREXT64 when filesystem doesn't support nrext64 Clear the nrext64 inode flag if the filesystem doesn't have the nrext64 feature enabled in the superblock. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Eric Sandeen --- repair/dinode.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/repair/dinode.c b/repair/dinode.c index 00de31fb1..7610cd456 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -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")); -- 2.47.3