/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright (C) 2019 Oracle. All Rights Reserved. * Author: Darrick J. Wong <darrick.wong@oracle.com>
*/ #ifndef __XFS_HEALTH_H__ #define __XFS_HEALTH_H__
struct xfs_group;
/* * In-Core Filesystem Health Assessments * ===================================== * * We'd like to be able to summarize the current health status of the * filesystem so that the administrator knows when it's necessary to schedule * some downtime for repairs. Until then, we would also like to avoid abrupt * shutdowns due to corrupt metadata. * * The online scrub feature evaluates the health of all filesystem metadata. * When scrub detects corruption in a piece of metadata it will set the * corresponding sickness flag, and repair will clear it if successful. If * problems remain at unmount time, we can also request manual intervention by * logging a notice to run xfs_repair. * * Each health tracking group uses a pair of fields for reporting. The * "checked" field tell us if a given piece of metadata has ever been examined, * and the "sick" field tells us if that piece was found to need repairs. * Therefore we can conclude that for a given sick flag value: * * - checked && sick => metadata needs repair * - checked && !sick => metadata is ok * - !checked && sick => errors have been observed during normal operation, * but the metadata has not been checked thoroughly * - !checked && !sick => has not been examined since mount * * Evidence of health problems can be sorted into three basic categories: * * a) Primary evidence, which signals that something is defective within the * general grouping of metadata. * * b) Secondary evidence, which are side effects of primary problem but are * not themselves problems. These can be forgotten when the primary * health problems are addressed. * * c) Indirect evidence, which points to something being wrong in another * group, but we had to release resources and this is all that's left of * that state.
*/
/* Don't propagate sick status to ag health summary during inactivation */ #define XFS_SICK_INO_FORGET (1 << 12) #define XFS_SICK_INO_DIRTREE (1 << 13) /* directory tree structure */
/* Primary evidence of health problems in a given group. */ #define XFS_SICK_FS_PRIMARY (XFS_SICK_FS_COUNTERS | \
XFS_SICK_FS_UQUOTA | \
XFS_SICK_FS_GQUOTA | \
XFS_SICK_FS_PQUOTA | \
XFS_SICK_FS_QUOTACHECK | \
XFS_SICK_FS_NLINKS | \
XFS_SICK_FS_METADIR | \
XFS_SICK_FS_METAPATH)
/* Secondary state related to (but not primary evidence of) health problems. */ #define XFS_SICK_FS_SECONDARY (0) #define XFS_SICK_RG_SECONDARY (0) #define XFS_SICK_AG_SECONDARY (0) #define XFS_SICK_INO_SECONDARY (XFS_SICK_INO_FORGET)
/* Evidence of health problems elsewhere. */ #define XFS_SICK_FS_INDIRECT (0) #define XFS_SICK_RG_INDIRECT (0) #define XFS_SICK_AG_INDIRECT (XFS_SICK_AG_INODES) #define XFS_SICK_INO_INDIRECT (0)
/* All health masks. */ #define XFS_SICK_FS_ALL (XFS_SICK_FS_PRIMARY | \
XFS_SICK_FS_SECONDARY | \
XFS_SICK_FS_INDIRECT)
/* * These functions must be provided by the xfs implementation. Function * behavior with respect to the first argument should be as follows: * * xfs_*_mark_sick: Set the sick flags and do not set checked flags. * Runtime code should call this upon encountering * a corruption. * * xfs_*_mark_corrupt: Set the sick and checked flags simultaneously. * Fsck tools should call this when corruption is * found. * * xfs_*_mark_healthy: Clear the sick flags and set the checked flags. * Fsck tools should call this after correcting errors. * * xfs_*_measure_sickness: Return the sick and check status in the provided * out parameters.
*/
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.