• Qu Wenruo's avatar
    btrfs: raid56: do extra dumping for CONFIG_BTRFS_ASSERT · bbbee460
    Qu Wenruo authored
    There are several hard-to-hit ASSERT()s hit inside raid56.
    Unfortunately the ASSERT() expression is a little complex, and except
    the ASSERT(), there is nothing to provide any clue.
    
    Considering if race is involved, it's pretty hard to reproduce.
    Meanwhile sometimes the dump of the rbio structure can provide some
    pretty good clues, it's worth to do the extra multi-line dump for
    btrfs raid56 related code.
    
    The dump looks like this:
    
      BTRFS critical (device dm-3): bioc logical=4598530048 full_stripe=4598530048 size=0 map_type=0x81 mirror=0 replace_nr_stripes=0 replace_stripe_src=-1 num_stripes=5
      BTRFS critical (device dm-3):     nr=0 devid=1 physical=1166147584
      BTRFS critical (device dm-3):     nr=1 devid=2 physical=1145176064
      BTRFS critical (device dm-3):     nr=2 devid=4 physical=1145176064
      BTRFS critical (device dm-3):     nr=3 devid=5 physical=1145176064
      BTRFS critical (device dm-3):     nr=4 devid=3 physical=1145176064
      BTRFS critical (device dm-3): rbio flags=0x0 nr_sectors=80 nr_data=4 real_stripes=5 stripe_nsectors=16 scrubp=0 dbitmap=0x0
      BTRFS critical (device dm-3): logical=4598530048
      assertion failed: orig_logical >= full_stripe_start && orig_logical + orig_len <= full_stripe_start + rbio->nr_data * BTRFS_STRIPE_LEN, in fs/btrfs/raid56.c:1702
    Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    bbbee460
raid56.c 77.2 KB