• B
    xfs: drain the buffer LRU on mount · f1b92bbc
    Brian Foster 提交于
    Log recovery of v4 filesystems does not use buffer verifiers because
    log recovery historically can result in transient buffer corruption
    when target buffers might be ahead of the log after a crash. v5
    filesystems work around this problem with metadata LSN ordering.
    
    While this log recovery verifier behavior is necessary on v4 supers,
    it can result in leaving buffers around in the LRU without verifiers
    attached for a significant amount of time. This leads to use of
    unverified buffers while the filesystem is in active use, long after
    recovery has completed.
    
    To address this problem, drain all buffers from the LRU as a final
    step of the log mount sequence. Note that this is done
    unconditionally to provide a consistently clean cache footprint,
    regardless of superblock version or log state. As a side effect,
    this ensures that all cache resident, unverified buffers are
    reclaimed after log recovery and therefore must be recreated with
    verifiers on subsequent use.
    Reported-by: NDarrick Wong <darrick.wong@oracle.com>
    Signed-off-by: NBrian Foster <bfoster@redhat.com>
    Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
    f1b92bbc
xfs_log.c 114.5 KB