/* Set us up to check the rtsummary file. */ int
xchk_setup_rtsummary( struct xfs_scrub *sc)
{ struct xfs_mount *mp = sc->mp; char *descr; struct xchk_rtsummary *rts; int error;
if (xchk_need_intent_drain(sc))
xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN);
if (!xfs_verify_rtbext(mp, rtbno, rtlen)) {
xchk_ino_xref_set_corrupt(sc, rtg_bitmap(rtg)->i_ino); return -EFSCORRUPTED;
}
/* Bump the summary count. */
error = xfsum_load(sc, offs, &v); if (error) return error;
value = xchk_rtsum_inc(sc->mp, &v);
trace_xchk_rtsum_record_free(mp, rec->ar_startext, rec->ar_extcount,
lenlog, offs, value);
return xfsum_store(sc, offs, v);
}
/* Compute the realtime summary from the realtime bitmap. */ STATICint
xchk_rtsum_compute( struct xfs_scrub *sc)
{ struct xfs_mount *mp = sc->mp; struct xfs_rtgroup *rtg = sc->sr.rtg;
/* If the bitmap size doesn't match the computed size, bail. */ if (XFS_FSB_TO_B(mp, xfs_rtbitmap_blockcount(mp)) !=
rtg_bitmap(rtg)->i_disk_size) return -EFSCORRUPTED;
/* Compare the rtsummary file against the one we computed. */ STATICint
xchk_rtsum_compare( struct xfs_scrub *sc)
{ struct xfs_bmbt_irec map; struct xfs_iext_cursor icur;
/* Mappings may not cross or lie beyond EOF. */
endoff = XFS_B_TO_FSB(mp, ip->i_disk_size); if (xfs_iext_lookup_extent(ip, &ip->i_df, endoff, &icur, &map)) {
xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, endoff); return0;
}
while (off < endoff) { int nmap = 1;
if (xchk_should_terminate(sc, &error)) return error; if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) return0;
/* Make sure we have a written extent. */
error = xfs_bmapi_read(ip, off, endoff - off, &map, &nmap,
XFS_DATA_FORK); if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, off, &error)) return error;
/* Is sb_rextents correct? */ if (mp->m_sb.sb_rextents != rts->rextents) {
xchk_ino_set_corrupt(sc, rbmip->i_ino); return0;
}
/* Is m_rsumlevels correct? */ if (mp->m_rsumlevels != rts->rsumlevels) {
xchk_ino_set_corrupt(sc, rsumip->i_ino); return0;
}
/* Is m_rsumsize correct? */ if (mp->m_rsumblocks != rts->rsumblocks) {
xchk_ino_set_corrupt(sc, rsumip->i_ino); return0;
}
/* The summary file length must be aligned to an fsblock. */ if (rsumip->i_disk_size & mp->m_blockmask) {
xchk_ino_set_corrupt(sc, rsumip->i_ino); return0;
}
/* Invoke the fork scrubber. */
error = xchk_metadata_inode_forks(sc); if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) return error;
/* Construct the new summary file from the rtbitmap. */
error = xchk_rtsum_compute(sc); if (error == -EFSCORRUPTED) { /* *EFSCORRUPTEDmeansthertbitmapiscorrupt,whichisanxref *errorsincewe'recheckingthesummaryfile.
*/
xchk_ino_set_corrupt(sc, rbmip->i_ino); return0;
} if (error) return error;
/* Does the computed summary file match the actual rtsummary file? */ return xchk_rtsum_compare(sc);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-09-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.