• Brian Foster's avatar
    xfs: recheck buffer pinned status after push trylock failure · 5337fe9b
    Brian Foster authored
    The buffer pinned check and trylock sequence in xfs_buf_item_push()
    can race with an active transaction on marking the buffer pinned.
    This can result in the buffer becoming pinned and stale after the
    initial check and the trylock failure, but before the check in
    xfs_buf_trylock() that issues a log force. If the log force is
    issued from this context, a spinlock recursion occurs on xa_lock.
    
    Prepare xfs_buf_item_push() to handle the race by detecting a
    pinned buffer after the trylock failure so xfsaild issues a log
    force from a safe context. This, along with various previous fixes,
    renders the log force in xfs_buf_trylock() redundant.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Signed-off-by: default avatarBen Myers <bpm@sgi.com>
    5337fe9b
xfs_buf_item.c 30.4 KB