[lkml]   [2002]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: O_DIRECT fails in some kernel and FS
    Chris Mason wrote:

    >On Saturday, February 02, 2002 08:54:38 PM +0100 Andrea Arcangeli <> wrote:
    >>>Chris and I had initially decided to unpack the tails on file open
    >>>if O_DIRECT is used, but it seems cleaner to add a
    >>>reiserfs_get_block_direct_io, and have it return -EINVAL if a read
    >>>went to a tail. writes that happen to a tail will trigger tail
    >>This is a safe approch (no risk of corruption etc..). However to provide
    >>the same semantics of the other filesystems it would be even better if
    >>we could unpack the tail within reiserfs_get_block_direct_io rather than
    >>returning -EINVAL, but ok, most apps should work fine anyways (and as
    >>worse people can workaround the magic by remounting reiserfs with notail
    >>before writing the data that will need to be handled later via
    >In the normal case, O_DIRECT can't be done on a file with a tail.
    >The way I read generic_file_direct_IO, O_DIRECT is only done in
    >units that start block aligned, and continue for a block aligned
    >length. So, this can never include a packed file tail.
    >We should only need to worry if i_size on the file is wrong, and allows a
    >read/write to a block aligned chunk on a file with a tail, which should
    >only be legal in the expanding truncate case from older kernels. The
    >-EINVAL return should only happen in this (very unlikely) case.
    Can't you fall back to buffered I/O for the tail? OK it complicates the
    code, probably a lot, but it keeps things sane from the user's point of


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:23    [W:0.025 / U:40.720 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site