• Qu Wenruo's avatar
    btrfs: output mirror number for bad metadata · 8f0ed7d4
    Qu Wenruo authored
    When handling a real world transid mismatch image, it's hard to know
    which copy is corrupted, as the error messages just look like this:
    
      BTRFS warning (device dm-3): checksum verify failed on 30408704 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
      BTRFS warning (device dm-3): checksum verify failed on 30408704 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
      BTRFS warning (device dm-3): checksum verify failed on 30408704 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
      BTRFS warning (device dm-3): checksum verify failed on 30408704 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
    
    We don't even know if the retry is caused by btrfs or the VFS retry.
    
    To make things a little easier to read, add mirror number for all
    related tree block read errors.
    
    So the above messages would look like this:
    
      BTRFS warning (device dm-3): checksum verify failed on logical 30408704 mirror 1 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
      BTRFS warning (device dm-3): checksum verify failed on logical 30408704 mirror 2 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
      BTRFS warning (device dm-3): checksum verify failed on logical 30408704 mirror 1 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
      BTRFS warning (device dm-3): checksum verify failed on logical 30408704 mirror 2 wanted 0xcdcdcdcd found 0x3c0adc8e level 0
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    [ update messages, add "logical" ]
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    8f0ed7d4
disk-io.c 146 KB