From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Check the bigtime iflag in relation to the fs feature set. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- repair/dinode.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/repair/dinode.c b/repair/dinode.c index ad2f672d8703..3507cd06075d 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -2173,7 +2173,8 @@ check_nsec( union xfs_timestamp *t, int *dirty) { - if ((dip->di_flags2 & be64_to_cpu(XFS_DIFLAG2_BIGTIME)) || + if ((dip->di_version >= 3 && + (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_BIGTIME))) || be32_to_cpu(t->t_nsec) < NSEC_PER_SEC) return; @@ -2601,6 +2602,16 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"), flags2 &= ~XFS_DIFLAG2_COWEXTSIZE; } + if ((flags2 & XFS_DIFLAG2_BIGTIME) && + !xfs_sb_version_hasbigtime(&mp->m_sb)) { + if (!uncertain) { + do_warn( + _("inode %" PRIu64 " is marked bigtime but file system does not support large timestamps\n"), + lino); + } + flags2 &= ~XFS_DIFLAG2_BIGTIME; + } + if (!verify_mode && flags2 != be64_to_cpu(dino->di_flags2)) { if (!no_modify) { do_warn(_("fixing bad flags2.\n"));