• J
    btrfs: scrub: fix uninitialized return value in recover_scrub_rbio · e7fc357e
    Josef Bacik 提交于
    Commit 75b47033 ("btrfs: raid56: migrate recovery and scrub recovery
    path to use error_bitmap") introduced an uninitialized return variable.
    
    This can be caught by gcc 12.1 by -Wmaybe-uninitialized:
    
      CC [M]  fs/btrfs/raid56.o
    fs/btrfs/raid56.c: In function ‘scrub_rbio’:
    fs/btrfs/raid56.c:2801:15: warning: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
     2801 |         ret = recover_scrub_rbio(rbio);
          |               ^~~~~~~~~~~~~~~~~~~~~~~~
    fs/btrfs/raid56.c:2649:13: note: ‘ret’ was declared here
     2649 |         int ret;
    
    The warning is disabled by default so we haven't caught that.
    
    Due to the bug the raid56 scrub fstests have been failing since the
    patch was merged, so initialize that.
    
    Fixes: 75b47033 ("btrfs: raid56: migrate recovery and scrub recovery path to use error_bitmap")
    Signed-off-by: NJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: NDavid Sterba <dsterba@suse.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    e7fc357e
raid56.c 75.0 KB