}
}
+static inline bool
+should_have_metadir_iflag(
+ struct xfs_mount *mp,
+ xfs_ino_t ino)
+{
+ if (ino == mp->m_sb.sb_metadirino)
+ return true;
+ if (ino == mp->m_sb.sb_rbmino)
+ return true;
+ if (ino == mp->m_sb.sb_rsumino)
+ return true;
+ if (ino == mp->m_sb.sb_uquotino)
+ return true;
+ if (ino == mp->m_sb.sb_gquotino)
+ return true;
+ if (ino == mp->m_sb.sb_pquotino)
+ return true;
+ return false;
+}
+
/*
* returns 0 if the inode is ok, 1 if the inode is corrupt
* check_dups can be set to 1 *only* when called by the
}
}
+ if (flags2 & XFS_DIFLAG2_METADATA) {
+ xfs_failaddr_t fa;
+
+ fa = libxfs_dinode_verify_metadir(mp, dino, di_mode,
+ be16_to_cpu(dino->di_flags), flags2);
+ if (fa) {
+ if (!uncertain)
+ do_warn(
+ _("inode %" PRIu64 " is incorrectly marked as metadata\n"),
+ lino);
+ goto clear_bad_out;
+ }
+ } else if (xfs_has_metadir(mp) &&
+ should_have_metadir_iflag(mp, lino)) {
+ if (!uncertain)
+ do_warn(
+ _("inode %" PRIu64 " should be marked as metadata\n"),
+ lino);
+ goto clear_bad_out;
+ }
+
if ((flags2 & XFS_DIFLAG2_REFLINK) &&
!xfs_has_reflink(mp)) {
if (!uncertain) {