Bug 4527 - sendfile(2) fails improperly on CIFS mounts
Summary: sendfile(2) fails improperly on CIFS mounts
Status: RESOLVED FIXED
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: Other Linux
: P3 normal
Target Milestone: ---
Assignee: Jeff Layton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-19 21:07 UTC by Dan Merillat
Modified: 2009-07-26 08:35 UTC (History)
1 user (show)

See Also:


Attachments
Trivial sendfile(2) program (1.60 KB, text/plain)
2007-04-19 21:09 UTC, Dan Merillat
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Merillat 2007-04-19 21:07:34 UTC
Tested from 2.6.17 - 2.6.20 64 bit kernels from kernel.org.

Results on reiserfs filesystem:
sendfile(3, 5, [0], 2097152)            = 2097152
and on a CIFS filesystem:
sendfile(3, 5, [0], 2097152)            = -1 EOVERFLOW (Value too large for defined data type)

At the same time, the recieving side reads the proper amount of data (I haven't tested for corruptions yet) and the offset (arg3) is updated to the correct value.

This would seem to indicate that it is in fact working, and the return path is picking up an error where it shouldn't.   In addition, it's possibly confined to 64-bit kernels.  (32/64 userspace makes no difference).

I tried looking at it, but got lost in the generic_mapped_read and FS callbacks there.

Same file data is used for both tests.
Comment 1 Dan Merillat 2007-04-19 21:09:24 UTC
Created attachment 2393 [details]
Trivial sendfile(2) program

short test program that creates a socketpair and uses sendfile(2) across it.
Comment 2 Steve French 2007-07-22 16:45:59 UTC
Do you know if this still fails on current kernels?
Comment 3 Jeff Layton 2009-07-26 08:34:38 UTC
Patch pushed upstream to fix this issue:

http://lists.samba.org/archive/linux-cifs-client/2009-July/005056.html

...it should make 2.6.31 and will likely be pushed to the stable kernel releases. Closing as FIXED.
Comment 4 Jeff Layton 2009-07-26 08:35:17 UTC
Closing as FIXED -- please reopen if it's not working correctly with the proposed patch in place.