Bug 218320 - splice with SPLICE_F_NONBLOCK returns -1 EAGAIN on writeable pipes
splice with SPLICE_F_NONBLOCK returns -1 EAGAIN on writeable pipes
Status: CLOSED INSUFFICIENT_DATA
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Brian Brock
:
Depends On:
Blocks: 427887
  Show dependency treegraph
 
Reported: 2006-12-04 12:33 EST by James Antill
Modified: 2008-02-07 23:28 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-07 23:28:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description James Antill 2006-12-04 12:33:17 EST
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 12:33:18 EST
Created attachment 142752 [details]
Test splice call and flags.
Comment 2 Jon Stanley 2008-01-07 20:50:49 EST
(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-07 23:28:59 EST
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.