Skip to content
  1. Mar 11, 2021
    • David Sterba's avatar
      btrfs: raid56: simplify tracking of Q stripe presence · c1a77dbc
      David Sterba authored
      commit c17af965
      
       upstream.
      
      There are temporary variables tracking the index of P and Q stripes, but
      none of them is really used as such, merely for determining if the Q
      stripe is present. This leads to compiler warnings with
      -Wunused-but-set-variable and has been reported several times.
      
      fs/btrfs/raid56.c: In function ‘finish_rmw’:
      fs/btrfs/raid56.c:1199:6: warning: variable ‘p_stripe’ set but not used [-Wunused-but-set-variable]
       1199 |  int p_stripe = -1;
            |      ^~~~~~~~
      fs/btrfs/raid56.c: In function ‘finish_parity_scrub’:
      fs/btrfs/raid56.c:2356:6: warning: variable ‘p_stripe’ set but not used [-Wunused-but-set-variable]
       2356 |  int p_stripe = -1;
            |      ^~~~~~~~
      
      Replace the two variables with one that has a clear meaning and also get
      rid of the warnings. The logic that verifies that there are only 2
      valid cases is unchanged.
      
      Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1a77dbc
  2. Mar 07, 2021