• Filipe Manana's avatar
    btrfs: fix uninitialized return value from btrfs_reclaim_sweep() · ecb54277
    Filipe Manana authored
    The return variable 'ret' at btrfs_reclaim_sweep() is never assigned if
    none of the space infos is reclaimable (for example if periodic reclaim
    is disabled, which is the default), so we return an undefined value.
    
    This can be fixed my making btrfs_reclaim_sweep() not return any value
    as well as do_reclaim_sweep() because:
    
    1) do_reclaim_sweep() always returns 0, so we can make it return void;
    
    2) The only caller of btrfs_reclaim_sweep() (btrfs_reclaim_bgs()) doesn't
       care about its return value, and in its context there's nothing to do
       about any errors anyway.
    
    Therefore remove the return value from btrfs_reclaim_sweep() and
    do_reclaim_sweep().
    
    Fixes: e4ca3932 ("btrfs: periodic block_group reclaim")
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    ecb54277
space-info.c 65.9 KB