• Alexandre Oliva's avatar
    btrfs: do away with non-whole_page extent I/O · 17a5adcc
    Alexandre Oliva authored
    end_bio_extent_readpage computes whole_page based on bv_offset and
    bv_len, without taking into account that blk_update_request may modify
    them when some of the blocks to be read into a page produce a read
    error.  This would cause the read to unlock only part of the file
    range associated with the page, which would in turn leave the entire
    page locked, which would not only keep the process blocked instead of
    returning -EIO to it, but also prevent any further access to the file.
    
    It turns out that btrfs always issues whole-page reads and writes.
    The special handling of non-whole_page appears to be a mistake or a
    left-over from a time when this wasn't the case.  Indeed,
    end_bio_extent_writepage distinguished between whole_page and
    non-whole_page writes but behaved identically in both cases!
    
    I've replaced the whole_page computations with warnings, just to be
    sure that we're not issuing partial page reads or writes.  The
    warnings should probably just go away some time.
    Signed-off-by: default avatarAlexandre Oliva <oliva@gnu.org>
    Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
    17a5adcc
extent_io.c 125 KB