Bug 218320 - splice with SPLICE_F_NONBLOCK returns -1 EAGAIN on writeable pipes
Summary: splice with SPLICE_F_NONBLOCK returns -1 EAGAIN on writeable pipes
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks: 427887
TreeView+ depends on / blocked
 
Reported: 2006-12-04 17:33 UTC by James Antill
Modified: 2008-02-08 04:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-02-08 04:28:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Test splice call and flags. (6.69 KB, text/x-csrc)
2006-12-04 17:33 UTC, James Antill
no flags Details

Description James Antill 2006-12-04 17:33:17 UTC
Description of problem:
 Although there is no documentation on splice() I assume that SPLICE_F_NONBLOCK
is supposed to be the same as having a nonblocking flag on the pipe ... this
isn't so, with the SPLICE_F_NONBLOCK flag splice() can return -1 EAGAIN when
poll() says the pipe is ready to accept data.
 strace:

poll([{fd=4, events=POLLOUT, revents=POLLOUT}, {fd=6, events=POLLOUT,
revents=POLLOUT}], 2, -1) = 2
SYS_313(0x7, 0, 0x4, 0, 0x3d060000)     = -1 EAGAIN (Resource temporarily
unavailable)
SYS_313(0x9, 0, 0x6, 0, 0x618e000)      = -1 EAGAIN (Resource temporarily
unavailable)

...I've included a test program.
 Note that even if I'm wrong in my assumption of what SPLICE_F_NONBLOCK does,
the only other thing I could imagine is that it is doing a real nonblock on the
page cache too ... and I've included readahead() calls which should "fix" that
(although not having a working poll() would make that definition much less useful).

Version-Release number of selected component (if applicable):
% uname -a                                        ~/glibc-tst-rpms
Linux code.and.org 2.6.18-1.2849.fc6 #1 SMP Fri Nov 10 12:45:28 EST 2006 i686
athlon i386 GNU/Linux

...note that although the syscall is in glibc FC6, it's broken (fixed in
rawhide) if you have a rawhide/test glibc and want to make sure it's not that
just change the LOCAL_SPLICE define -- I've done this in my testing.

How reproducible:
 Always

Additional info:
 See the attached splice test application. Note that if you change
USE_O_NONBLOCK_R from 0 to 1 and USE_SPLICE_NONBLOCK_R from 1 to 0, the test
program will use fcntl() O_NONBLOCK instead of the SPLICE_F_NONBLOCK flag which
does the exected thing.

 Use it like:

./splicetst /tmp/big_1GB /tmp/o1 /tmp/big_100MB /tmp/o2

Comment 1 James Antill 2006-12-04 17:33:18 UTC
Created attachment 142752 [details]
Test splice call and flags.

Comment 2 Jon Stanley 2008-01-08 01:50:49 UTC
(This is a mass-update to all current FC6 kernel bugs in NEW state)

Hello,

I'm reviewing this bug list as part of the kernel bug triage project, an attempt
to isolate current bugs in the Fedora kernel.

http://fedoraproject.org/wiki/KernelBugTriage

I am CC'ing myself to this bug, however this version of Fedora is no longer
maintained.

Please attempt to reproduce this bug with a current version of Fedora (presently
Fedora 8). If the bug no longer exists, please close the bug or I'll do so in a
few days if there is no further information lodged.

Thanks for using Fedora!

Comment 3 Jon Stanley 2008-02-08 04:28:59 UTC
Per the previous comment in this bug, I am closing it as INSUFFICIENT_DATA,
since no information has been lodged for over 30 days.

Please re-open this bug or file a new one if you can provide the requested data,
and thanks for filing the original report!


Note You need to log in before you can comment on or make changes to this bug.