Skip to content
  • Miklos Szeredi's avatar
    splice: fix misuse of SPLICE_F_NONBLOCK · 6965031d
    Miklos Szeredi authored
    
    
    SPLICE_F_NONBLOCK is clearly documented to only affect blocking on the
    pipe.  In __generic_file_splice_read(), however, it causes an EAGAIN
    if the page is currently being read.
    
    This makes it impossible to write an application that only wants
    failure if the pipe is full.  For example if the same process is
    handling both ends of a pipe and isn't otherwise able to determine
    whether a splice to the pipe will fill it or not.
    
    We could make the read non-blocking on O_NONBLOCK or some other splice
    flag, but for now this is the simplest fix.
    
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    CC: stable@kernel.org
    Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
    6965031d