• Chris Mason's avatar
    Btrfs: make sure the async caching thread advances the key · 013f1b12
    Chris Mason authored
    The async caching thread can end up looping forever if a given
    search puts it at the last key in a leaf.  It will end up calling
    btrfs_next_leaf and then checking if it needs to politely drop
    the read semaphore.
    
    Most of the time this looping isn't noticed because it is able to
    make progress the next time around.  But, during log replay,
    we wait on the async caching thread to finish, and the async thread
    is waiting on the commit, and no progress is really made.
    
    The fix used here is to copy the key out of the next leaf,
    that way our search lands there properly.
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    013f1b12
extent-tree.c 194 KB