• Liu Bo's avatar
    Btrfs: bring back repair during read · 9d0d1c8b
    Liu Bo authored
    Commit 20a7db8a ("btrfs: add dummy callback for readpage_io_failed
    and drop checks") made a cleanup around readpage_io_failed_hook, and
    it was supposed to keep the original sematics, but it also
    unexpectedly disabled repair during read for dup, raid1 and raid10.
    
    This fixes the problem by letting data's inode call the generic
    readpage_io_failed callback by returning -EAGAIN from its
    readpage_io_failed_hook in order to notify end_bio_extent_readpage to
    do the rest.  We don't call it directly because the generic one takes
    an offset from end_bio_extent_readpage() to calculate the index in the
    checksum array and inode's readpage_io_failed_hook doesn't offer that
    offset.
    
    Cc: David Sterba <dsterba@suse.cz>
    Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    [ keep the const function attribute ]
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    9d0d1c8b
extent_io.c 149 KB