• Josef Bacik's avatar
    fs: allow short direct-io reads to be completed via buffered IO · 66f998f6
    Josef Bacik authored
    This is similar to what already happens in the write case.  If we have a short
    read while doing O_DIRECT, instead of just returning, fallthrough and try to
    read the rest via buffered IO.  BTRFS needs this because if we encounter a
    compressed or inline extent during DIO, we need to fallback on buffered.  If the
    extent is compressed we need to read the entire thing into memory and
    de-compress it into the users pages.  I have tested this with fsx and everything
    works great.  Thanks,
    Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    66f998f6
filemap.c 66 KB