lkml.org 
[lkml]   [2010]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] splice: allow non-block splice only when in file is seekable
From
Date
On Wed, 26 May 2010, Changli Gao wrote:
> On Wed, May 26, 2010 at 6:29 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> > On Wed, 26 May 2010, Changli Gao wrote:
> >> allow non-block splice only when in file is seekable.
> >>
> >> do_splice_to() is split to two parts: read data from in file to spd, and move
> >> data from spd to pipe. If there isn't much space in pipe for the data in spd,
> >> and the splice is called with non-block flag, the data dropped due to non
> >> enough space in pipe will be lost forever when in file isn't seekable.
> >
> > This is a gratuitous ABI change.  I don't think we should hold the
> > hand of application writers,
>
> Yea, it is an ABI change. But without that, we'll fail user silently
> currently. Some fundamental change is needed to fix this issue fully,
> if you think it is a bug.

I don't think it's a bug. The same thing will happen without
SPLICE_F_NONBLOCK if splice_to_pipe() is interrupted by a signal while
it blocks.

To prevent data loss the application needs to be aware of the fact
that doing a splice from a non-seekable fd needs to be done carefully,
making sure that it doesn't block on the pipe.

Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-05-26 14:27    [W:0.058 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site