• Andrew Morton's avatar
    [PATCH] direct-io hole fix · 50ce176c
    Andrew Morton authored
    From: Chris Mason <mason@suse.com>
    
    When filling holes via DIRECT_IO, we fall back to normal buffered io.  For
    this to work properly, the direct io funcs have to return a value of zero to
    the file write functions, so the file write functions know where to start
    writing. 
    
    In some cases, dio->result was getting returned by direct_io_worker, and that
    wasn't always zero, causing some data not to be written.
    
    From: <akpm@osdl.org>:
    
    - Simplify things by setting `ret' later on, fix up subsequent damage to the
      dio_complete() args.
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    50ce176c
direct-io.c 32 KB