Bug 42751 - CIFS mounted filesystems do not transmit files
CIFS mounted filesystems do not transmit files
Status: RESOLVED INVALID
Product: Apache httpd-2
Classification: Unclassified
Component: All
2.2.4
All Linux
: P2 critical (vote)
: ---
Assigned To: Apache HTTPD Bugs Mailing List
http://dev.9jr.com/
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-06-26 21:12 UTC by Jacques Amar
Modified: 2007-06-27 09:02 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacques Amar 2007-06-26 21:12:50 UTC
A Windows Server 2003 share mounted on a Linux system that works in otherwise
every other way fails to transfer files through apache 2.2.4

/etc/fstab entry:
//server/share   /mnt/data               cifs  
credentials=/root/.samba/credentials       0 0

(alse experimented with
rsize=32768,file_mode=0664,dir_mode=0775,nomapchars,noacl,nobrl,sfu,gid=apache,uid=apache)

The virtualhost is simply:

<VirtualHost *:80>
    ServerAdmin xxx@9jr.com
    # DocumentRoot /web/9jr.com/html
    DocumentRoot /mnt/data
    ServerName 9jr.com
    ServerAlias *.9jr.com
    ErrorLog logs/9jr.com-error_log
    # CustomLog /dev/null common
    CustomLog logs/9jr.com-access_log common

    # RewriteEngine On

    # Pattern Substitution


        <Location />
    Options Indexes FollowSymlinks MultiViews
        </Location>

        Alias /pics "/BACKUP/pics"
        <Directory "/BACKUP/pics">
                Options Indexes FollowSymLinks MultiViews
        </Directory>

    DirectoryIndex index.cgi index.html index.htm
</VirtualHost>

No other mounted filesystem displays this behavior

This behavior was confirmed on FC7 and CentOS5
Comment 1 Jacques Amar 2007-06-26 21:18:31 UTC
Directory traversing works great.

On CentOS 5, around 32K is transmitted before the connection is closed. 
A larger image than 32K can be eventually downloaded with repeated go button push.

On FC7, 0 bytes are transmitted.

I used wget to see what happens:

$ wget http://dev.9jr.com/Mvc-005s.jpg
--21:17:57--  http://dev.9jr.com/Mvc-005s.jpg
           => `Mvc-005s.jpg'
Resolving dev.9jr.com... 66.92.42.141
Connecting to dev.9jr.com|66.92.42.141|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25,177 (25K) [image/jpeg]

 0% [                                                                          
                                                                               
               ] 0             --.--K/s             

21:18:00 (0.00 B/s) - Connection closed at byte 0. Retrying.

--21:18:01--  http://dev.9jr.com/Mvc-005s.jpg
  (try: 2) => `Mvc-005s.jpg'
Connecting to dev.9jr.com|66.92.42.141|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25,177 (25K) [image/jpeg]
Mvc-005s.jpg has sprung into existence.
Retrying.

--21:18:03--  http://dev.9jr.com/Mvc-005s.jpg
  (try: 3) => `Mvc-005s.jpg.1'
Connecting to dev.9jr.com|66.92.42.141|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25,177 (25K) [image/jpeg]

 0% [                                                                          
                                                                               
               ] 0             --.--K/s             

21:18:03 (0.00 B/s) - Connection closed at byte 0. Retrying.
Comment 2 Ruediger Pluem 2007-06-27 00:56:54 UTC
Please set the following configuration directives in your httpd configuration
and check if the problem persists:

EnableSendfile Off
EnableMMAP Off

See also

http://httpd.apache.org/docs/2.2/en/mod/core.html#enablesendfile
http://httpd.apache.org/docs/2.2/en/mod/core.html#enablemmap

It is well know that network mounted file systems like NFS, SMB or CIFS can
cause these kind of problems in conjunction with sendfile and mmap.
Comment 3 Jacques Amar 2007-06-27 07:53:22 UTC
Thank you!

EnableSendfile Off 
did the trick. I guess I limited my searches to CIFS because I was not seeing a
problem with NFS mounts.

I wonder if I should contact the APR list about this, as apr_socket_sendfile
must be the culprit.

Also, should I set the status of the bug to 'FIXED' or something else like
'WONTFIX' ?

Thanks again
Comment 4 Ruediger Pluem 2007-06-27 09:02:15 UTC
(In reply to comment #3)
> Thank you!
> 
> EnableSendfile Off 
> did the trick. I guess I limited my searches to CIFS because I was not seeing a
> problem with NFS mounts.
> 
> I wonder if I should contact the APR list about this, as apr_socket_sendfile
> must be the culprit.

No need to do. This is a well known OS problem with sendfile and network file
systems on OS'es that support sendfile.

> 
> Also, should I set the status of the bug to 'FIXED' or something else like
> 'WONTFIX' ?

I mark it as invalid as it is the documented behaviour.