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.
Created attachment 271831 [details] Trace of IP where 192.168.0.49 = Windows box, 192.168.0.230 = fedora box
Thanks, I'll see if I can code up something that uses sendfile and see if we can get a reproducer for this.
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.
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.
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.