• D
    xfs: reinitialise per-AG structures if geometry changes during recovery · a798011c
    Dave Chinner 提交于
    If a crash occurs immediately after a filesystem grow operation, the
    updated superblock geometry is found only in the log. After we
    recover the log, the superblock is reread and re-initialised and so
    has the new geometry in memory. If the new geometry has more AGs
    than prior to the grow operation, then the new AGs will not have
    in-memory xfs_perag structurea associated with them.
    
    This will result in an oops when the first metadata buffer from a
    new AG is looked up in the buffer cache, as the block lies within
    the new geometry but then fails to find a perag structure on lookup.
    This is easily fixed by simply re-initialising the perag structure
    after re-reading the superblock at the conclusion of the first pahse
    of log recovery.
    
    This, however, does not fix the case of log recovery requiring
    access to metadata in the newly grown space. Fortunately for us,
    because the in-core superblock has not been updated, this will
    result in detection of access beyond the end of the filesystem
    and so recovery will fail at that point. If this proves to be
    a problem, then we can address it separately to the current
    reported issue.
    Reported-by: NAlex Lyakas <alex@zadarastorage.com>
    Tested-by: NAlex Lyakas <alex@zadarastorage.com>
    Signed-off-by: NDave Chinner <dchinner@redhat.com>
    a798011c
xfs_log_recover.c 142.7 KB