• Darrick J. Wong's avatar
    xfs: try to avoid allocating from sick inode clusters · 2935213a
    Darrick J. Wong authored
    I noticed that xfs/413 and xfs/375 occasionally failed while fuzzing
    core.mode of an inode.  The root cause of these problems is that the
    field we fuzzed (core.mode or core.magic, typically) causes the entire
    inode cluster buffer verification to fail, which affects several inodes
    at once.  The repair process tries to create either a /lost+found or a
    temporary repair file, but regrettably it picks the same inode cluster
    that we just corrupted, with the result that repair triggers the demise
    of the filesystem.
    
    Try avoid this by making the inode allocation path detect when the perag
    health status indicates that someone has found bad inode cluster
    buffers, and try to read the inode cluster buffer.  If the cluster
    buffer fails the verifiers, try another AG.  This isn't foolproof and
    can result in premature ENOSPC, but that might be better than shutting
    down.
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    2935213a
xfs_ialloc.c 82.5 KB