• David Sterba's avatar
    Revert "btrfs: switch to iomap_dio_rw() for dio" · 55e20bd1
    David Sterba authored
    This reverts commit a43a67a2.
    
    This patch reverts the main part of switching direct io implementation
    to iomap infrastructure. There's a problem in invalidate page that
    couldn't be solved as regression in this development cycle.
    
    The problem occurs when buffered and direct io are mixed, and the ranges
    overlap. Although this is not recommended, filesystems implement
    measures or fallbacks to make it somehow work. In this case, fallback to
    buffered IO would be an option for btrfs (this already happens when
    direct io is done on compressed data), but the change would be needed in
    the iomap code, bringing new semantics to other filesystems.
    
    Another problem arises when again the buffered and direct ios are mixed,
    invalidation fails, then -EIO is set on the mapping and fsync will fail,
    though there's no real error.
    
    There have been discussions how to fix that, but revert seems to be the
    least intrusive option.
    
    Link: https://lore.kernel.org/linux-btrfs/20200528192103.xm45qoxqmkw7i5yl@fiona/Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    55e20bd1
file.c 93.3 KB