• Josef Bacik's avatar
    btrfs: wake up async_delalloc_pages waiters after submit · ac98141d
    Josef Bacik authored
    We use the async_delalloc_pages mechanism to make sure that we've
    completed our async work before trying to continue our delalloc
    flushing.  The reason for this is we need to see any ordered extents
    that were created by our delalloc flushing.  However we're waking up
    before we do the submit work, which is before we create the ordered
    extents.  This is a pretty wide race window where we could potentially
    think there are no ordered extents and thus exit shrink_delalloc
    prematurely.  Fix this by waking us up after we've done the work to
    create ordered extents.
    
    CC: stable@vger.kernel.org # 5.4+
    Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    ac98141d
inode.c 305 KB