_("would clear rtgroup rmap inode %" PRIu64 "\n"),
ino);
}
+ } else if (is_rtrefcount_inode(ino)) {
+ refcount_avoid_check(mp);
+ if (!no_modify) {
+ do_warn(
+ _("cleared rtgroup refcount inode %" PRIu64 "\n"),
+ ino);
+ } else {
+ do_warn(
+ _("would clear rtgroup refcount inode %" PRIu64 "\n"),
+ ino);
+ }
} else if (!no_modify) {
do_warn(_("cleared inode %" PRIu64 "\n"),
ino);
if (is_rtrmap_inode(ino_num))
rmap_avoid_check(mp);
+
+ if (is_rtrefcount_inode(ino_num))
+ refcount_avoid_check(mp);
}
/*
lino);
return 1;
}
+ if (type != XR_INO_RTREFC) {
+ do_warn(
+_("rtrefcount inode %" PRIu64 " was not found in the metadata directory tree\n"),
+ lino);
+ return 1;
+ }
if (!is_rtrefcount_inode(lino)) {
do_warn(
error = process_rtrefc_reclist(mp, rp, numrecs,
&priv, "rtrefcountbt root");
if (error) {
- refcount_avoid_check();
+ refcount_avoid_check(mp);
return 1;
}
return 0;
if (is_rtrmap_inode(lino))
return process_check_rt_inode(mp, dinoc, lino, type, dirty,
XR_INO_RTRMAP, _("realtime rmap btree"));
+ if (is_rtrefcount_inode(lino))
+ return process_check_rt_inode(mp, dinoc, lino, type, dirty,
+ XR_INO_RTREFC, _("realtime refcount btree"));
return 0;
}
}
break;
+ case XR_INO_RTREFC:
+ /*
+ * if we have no refcountbt, any inode claiming
+ * to be a real-time file is bogus
+ */
+ if (!xfs_has_reflink(mp)) {
+ do_warn(
+_("found inode %" PRIu64 " claiming to be a rtrefcountbt file, but reflink is disabled\n"), lino);
+ return 1;
+ }
+ break;
+
default:
break;
}
}
break;
case XFS_DINODE_FMT_RMAP:
+ case XFS_DINODE_FMT_REFCOUNT:
if (!(xfs_has_metadir(mp) && xfs_has_parent(mp))) {
do_warn(
_("metadata inode %" PRIu64 " type %d cannot have attr fork\n"),
type = XR_INO_PQUOTA;
else if (is_rtrmap_inode(lino))
type = XR_INO_RTRMAP;
+ else if (is_rtrefcount_inode(lino))
+ type = XR_INO_RTREFC;
else
type = XR_INO_DATA;
break;
} else if (is_rtrmap_inode(lino)) {
junkit = 1;
junkreason = _("realtime rmap");
+ } else if (is_rtrefcount_inode(lino)) {
+ junkit = 1;
+ junkreason = _("realtime refcount");
} else if ((irec_p = find_inode_rec(mp,
XFS_INO_TO_AGNO(mp, lino),
XFS_INO_TO_AGINO(mp, lino))) != NULL) {
clearreason = _("metadata directory root");
} else if (is_rtrmap_inode(ent_ino)) {
clearreason = _("realtime rmap");
+ } else if (is_rtrefcount_inode(ent_ino)) {
+ clearreason = _("realtime refcount");
} else {
irec_p = find_inode_rec(mp,
XFS_INO_TO_AGNO(mp, ent_ino),
#define XR_INO_GQUOTA 13 /* group quota inode */
#define XR_INO_PQUOTA 14 /* project quota inode */
#define XR_INO_RTRMAP 15 /* realtime rmap */
+#define XR_INO_RTREFC 16 /* realtime refcount */
/* inode allocation tree */
* Disable the refcount btree check.
*/
void
-refcount_avoid_check(void)
+refcount_avoid_check(
+ struct xfs_mount *mp)
{
+ if (xfs_has_rtgroups(mp))
+ mark_rtgroup_inodes_bad(mp, XFS_RTGI_REFCOUNT);
refcbt_suspect = true;
}
extern int compute_refcounts(struct xfs_mount *, xfs_agnumber_t);
uint64_t refcount_record_count(struct xfs_mount *mp, xfs_agnumber_t agno);
extern int init_refcount_cursor(xfs_agnumber_t, struct xfs_slab_cursor **);
-extern void refcount_avoid_check(void);
+extern void refcount_avoid_check(struct xfs_mount *mp);
void check_refcounts(struct xfs_mount *mp, xfs_agnumber_t agno);
extern void record_inode_reflink_flag(struct xfs_mount *, struct xfs_dinode *,
libxfs_perag_put(pag);
out:
if (suspect)
- refcount_avoid_check();
+ refcount_avoid_check(mp);
return;
}
}
out:
if (suspect) {
- refcount_avoid_check();
+ refcount_avoid_check(mp);
return 1;
}
if (levels == 0 || levels > mp->m_refc_maxlevels) {
do_warn(_("bad levels %u for refcountbt root, agno %d\n"),
levels, agno);
- refcount_avoid_check();
+ refcount_avoid_check(mp);
}
bno = be32_to_cpu(agf->agf_refcount_root);
} else {
do_warn(_("bad agbno %u for refcntbt root, agno %d\n"),
bno, agno);
- refcount_avoid_check();
+ refcount_avoid_check(mp);
}
}