-
djwong committed
Sep 26, 2017 Whenever we load a buffer, explicitly re-call the structure verifier to ensure that memory isn't corrupting things. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: create a new buf_ops pointer to verify structure metadata
djwong committedSep 26, 2017 Expose all metadata structure buffer verifier functions via buf_ops. These will be used by the online scrub mechanism to look for problems with buffers that are already sitting around in memory. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: fail out of xfs_attr3_leaf_lookup_int if it looks corrupt
djwong committedSep 26, 2017 If the xattr leaf block looks corrupt, return -EFSCORRUPTED to userspace instead of ASSERTing on debug kernels or running off the end of the buffer on regular kernels. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: provide a centralized method for verifying inline fork data
djwong committedSep 26, 2017 Replace the current haphazard dir2 shortform verifier callsites with a centralized verifier function that can be called either with the default verifier functions or with a custom set. This helps us strengthen integrity checking while providing us with flexibility for repair tools. xfs_repair wants this to be able to supply its own verifier functions when trying to fix possibly corrupt metadata. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: refactor short form directory structure verifier function
djwong committedSep 26, 2017 Change the short form directory structure verifier function to return the instruction pointer of a failing check or NULL if everything's ok. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: create structure verifier function for short form symlinks
djwong committedSep 26, 2017 Create a function to check the structure of short form symlink targets. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: create structure verifier function for shortform xattrs
djwong committedSep 26, 2017 Create a function to perform structure verification for short form extended attributes. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: move inode fork verifiers to xfs_dinode_verify
djwong committedSep 26, 2017 Consolidate the fork size and format verifiers to xfs_dinode_verify so that we can reject bad inodes earlier and in a single place. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: verify dinode header first
djwong committedSep 26, 2017 Move the v3 inode integrity information (crc, owner, metauuid) before we look at anything else in the inode so that we don't waste time on a torn write or a totally garbled block. This makes xfs_dinode_verify more consistent with the other verifiers. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: refactor verifier callers to print address of failing check
djwong committedSep 26, 2017 Refactor the callers of verifiers to print the instruction address of a failing check. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: have buffer verifier functions report failing address
djwong committedSep 26, 2017 Modify each function that checks the contents of a metadata buffer to return the instruction address of the failing test so that we can report more precise failure errors to the log. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: remove XFS_WANT_CORRUPTED_RETURN from dir3 data verifiers
djwong committedSep 26, 2017 Since __xfs_dir3_data_check verifies on-disk metadata, we can't have it noisily blowing asserts and hanging the system on corrupt data coming in off the disk. Instead, have it return a boolean like all the other checker functions, and only have it noisily fail if we fail in debug mode. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: refactor long-format btree header verification routines
djwong committedSep 26, 2017 Create two helper functions to verify the headers of a long format btree block. We'll use this later for the realtime rmapbt. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: whine to dmesg when we encounter errors
djwong committedSep 26, 2017 Forward everything scrub whines about to dmesg. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Repair inconsistent symbolic link data. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Use the reverse-mapping btree information to rebuild an inode fork. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Try to reinitialize corrupt inodes, or clear the reflink flag if it's not needed. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Reconstruct the refcount data from the rmap btree. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Rebuild the reverse mapping btree from all primary metadata. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Use the rmapbt to find inode chunks, query the chunks to compute hole and free masks, and with that information rebuild the inobt and finobt. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Rebuild the free space btrees from the gaps in the rmap btree. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Rebuild the AGI header items with some help from the rmapbt. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 Regenerate the AGF and AGFL from the rmap data. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
djwong committed
Sep 26, 2017 If one of the backup superblocks is found to differ seriously from superblock 0, write out a fresh copy from the in-core sb. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: add helper routines for the repair code
djwong committedSep 26, 2017 Add some helper functions for repair functions that will help us to allocate and initialize new metadata blocks for btrees that we're rebuilding. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: implement the metadata repair ioctl flag
djwong committedSep 26, 2017 Plumb in the pieces necessary to make the "scrub" subfunction of the scrub ioctl actually work. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: create tracepoints for online repair
djwong committedSep 26, 2017 These tracepoints will be used to debug the online repair routines. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: halt auto-reclamation activities while rebuilding rmap
djwong committedSep 26, 2017 Rebuilding the reverse-mapping tree requires us to quiesce all inodes in the filesystem, so we must stop background reclamation of post-EOF and CoW prealloc blocks. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: add BMAPI_NORMAP flag to perform block remapping without updatin…
djwong committedSep 26, 2017 …g rmpabt Add a new flag, XFS_BMAPI_NORMAP, which will perform file block remapping without updating the rmapbt. This will be used by the repair code to reconstruct bmbts from the rmapbt, in which case we don't want the rmapbt update. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: add repair helpers for the reference count btree
djwong committedSep 26, 2017 Add a couple of functions to the refcount btree and generic btree code that will be used to repair the refcountbt. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: add repair helpers for the reverse mapping btree
djwong committedSep 26, 2017 Add a couple of functions to the reverse mapping btree that will be used to repair the rmapbt. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: expose various functions to repair code
djwong committedSep 26, 2017 Expose various helpers that the repair code will want to use. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: add helpers to calculate btree size
djwong committedSep 26, 2017 Add a bunch of helper functions that calculate the sizes of various btrees. These will be used to repair btrees and btree headers. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: abort scrubs if the oom killer fires
djwong committedSep 29, 2017 On a filesystem with a large amount of metadata, we can run the system nearly out of memory while we process metadata. If the OOM killer fires anywhere in the system, ask the running scrub processes to abort with ENOMEM and try again later. (This will become more of a problem with online repair where we will have to hold all of a reconstructed data structure in memory.) Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-
xfs: cross-reference the block mappings when possible
djwong committedSep 26, 2017 Use an inode's block mappings to cross-reference inode block counters and (if possible) cross reference rmapbt records against the bmbt to ensure that the bmbt isn't missing any records. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>