• Darrick J. Wong's avatar
    xfs: don't complain about unfixed metadata when repairs were injected · 8336a64e
    Darrick J. Wong authored
    
    
    While debugging other parts of online repair, I noticed that if someone
    injects FORCE_SCRUB_REPAIR, starts an IFLAG_REPAIR scrub on a piece of
    metadata, and the metadata repair fails, we'll log a message about
    uncorrected errors in the filesystem.
    
    This isn't strictly true if the scrub function didn't set OFLAG_CORRUPT
    and we're only doing the repair because the error injection knob is set.
    Repair functions are allowed to abort the entire operation at any point
    before committing new metadata, in which case the piece of metadata is
    in the same state as it was before.  Therefore, the log message should
    be gated on the results of the scrub.  Refactor the predicate and
    rearrange the code flow to make this happen.
    
    Note: If the repair function errors out after it commits the new
    metadata, the transaction cancellation will shut down the filesystem,
    which is an obvious sign of corrupt metadata.
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    8336a64e
scrub.c 17.7 KB