Bug 403531 - No files over 128 bytes can be transfered by apache from CIFS mounted folder
Summary: No files over 128 bytes can be transfered by apache from CIFS mounted folder
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 8
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jeff Layton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-28 21:49 UTC by Jeffrey R. Naujok
Modified: 2014-06-18 07:37 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-01-26 03:33:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Trace of IP where 192.168.0.49 = Windows box, 192.168.0.230 = fedora box (13.13 KB, application/octet-stream)
2007-11-28 21:49 UTC, Jeffrey R. Naujok
no flags Details
test program (1.28 KB, patch)
2007-12-24 11:19 UTC, Jeff Layton
no flags Details | Diff

Description Jeffrey R. Naujok 2007-11-28 21:49:53 UTC
Description of problem:
A Windows XP folder is shared and mounted through CIFS as a valid folder under a
web document directory for Apache. All files are accessible manually.
Permissions include world read. Apache is unable to serve out any file over 128
bytes from this directory. Any file over 128 bytes comes back as blank (0
bytes). Apache reports the file as correctly sent. 

Wireshark shows that after apache requests an open of the file for read (which
is successful) it immediately requests the close of the file with no actions
in-between.

Setting the flag "EnableSendfile" to "off" in Apache allows the files to be sent
normally.

Version-Release number of selected component (if applicable):
Fedora 8 - Kernel  2.6.23.1-49.fc8
Apache 2.2.6
samba 3.0.27
 

How reproducible:
It has happened enough that there are several threads on multiple forums about
the problem.

Steps to Reproduce:
1. Share folder from Windows XP machine
2. create folder in web document folder as mount point
3. do "mount -t cifs //server/folder /webroot/localfolder -o user=user
4. restart web server (apache)
5. use web browser to browse to directory. All files are listed.
6. Choose any file over 128 bytes. File will return blank.
  
Actual results:
Apache will "ship" any file under about 128 bytes. Any file over this size will
be shipped as a zero length file. Access log lists the file as being sent
correctly. 

Expected results:
The file would be "shipped" in it's entirety.

Additional info:
Wireshark trace showed that in case where file is over 128 bytes, apache does an
open request, then immediately follows with a close request. When file is under
128 bytes, it's data is included in the initial response. In longer files, it
does not do this. 

Setting the "EnableSendfile" flag to "Off" is an effective work-around for this
problem.

Wireshark traces are attached.

Comment 1 Jeffrey R. Naujok 2007-11-28 21:49:53 UTC
Created attachment 271831 [details]
Trace of IP where 192.168.0.49 = Windows box, 192.168.0.230 = fedora box

Comment 2 Jeff Layton 2007-11-28 21:59:02 UTC
Thanks, I'll see if I can code up something that uses sendfile and see if we can
get a reproducer for this.


Comment 3 Jeff Layton 2007-12-24 11:19:44 UTC
Created attachment 290347 [details]
test program

This is the test program I came up with. It seems to work fine on locally
mounted partitions, but when I try to use sendfile() on a CIFS mounted
partition it always returns -EOVERFLOW, regardless of the file size.

This seems like appropriate behavior though, since it consistently errors out.
I may play with apache a bit and see if I can replicate what you're seeing.

Comment 4 Jeff Layton 2007-12-24 11:41:07 UTC
Hmm...I don't seem to be able to reproduce this behavior with apache. I always
get the whole file. When I strace apache though, it's mmap'ing the file when
sending it (not using sendfile).

Would it be possible to have you revert the change you made to disable sendfile,
run apache in single-threaded mode and strace it?

i.e.:

# strace -f -o /tmp/httpd.strace httpd -X

...then try to pull a >128 file via a web browser from the cifs partition. After
that, kill -9 the above process and attach /tmp/httpd.strace to this case.

I want to make sure I'm accurately reproducing what you're seeing.


Comment 5 Jon Stanley 2008-01-26 03:33:17 UTC
Hello,

This bug has been in a state of NEEDINFO for more than 30 days.  Since no
further information has been entered into this report, I am closing this bug
INSUFFICIENT_DATA.  If you are able to provide the requested data, then please
feel free to re-open this bug, and thanks for taking the time to open the
original report.


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