• Qu Wenruo's avatar
    btrfs: scrub: introduce the main read repair worker for scrub_stripe · 9ecb5ef5
    Qu Wenruo authored
    The new helper, scrub_stripe_read_repair_worker(), would handle the
    read-repair part:
    
    - Wait for the previous submitted read IO to finish
    
    - Verify the contents of the stripe
    
    - Go through the remaining mirrors, using as large blocksize as possible
      At this stage, we just read out all the failed sectors from each
      mirror and re-verify.
      If no more failed sector, we can exit.
    
    - Go through all mirrors again, sector-by-sector
      This time, we read sector by sector, this is to address cases where
      one bad sector mismatches the drive's internal checksum, and cause the
      whole read range to fail.
    
      We put this recovery method as the last resort, as sector-by-sector
      reading is slow, and reading from other mirrors may have already fixed
      the errors.
    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>
    9ecb5ef5
scrub.h 1.02 KB