long cifs timeout when share becomes unavailable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

there are issues with cifs share mounted via mount.cifs (with recent
kernels): the first 'ls' on the dir where cifs share is mounted after the
server becomes unavailable 1) hangs (can't be interrupted with ^C) and 2)
lasts about 5 minutes. The first problem appears everywhere I tested
(ubuntu 10.04 with any distributed kernel, ubuntu 12.04, fedora 17), but
with old kernels (tested with ubuntu 10.04 2.6.32 and 2.6.35) 'ls' is
uninterruptable but hangs only for about 25 seconds (which makes this
problem really less complex for old kernels). And with new kernels (ubuntu
10.04 3.0, ubuntu 12.04 3.2, fedora 17 3.3) I'm facing very long hangs of
'ls' (the second problem). And many GUI applications (e.g. nautilus,
firefox, gnome-panel,mc) that query that directory for some reason appears
to act the same way as 'ls', so the system becomes unusable for 5(!)
minutes. When the server (tested with samba 3.6, win2003) becomes
unavailable nothing is written on the mounted directory, so I can't
understand why this timeout is so big. Here is how I tested this:

 # mount.cifs //fsrv/home /mnt "-ouser=test,dom=wg,soft"
 Password:
 # time ls /mnt
 Desktop Documents Program Files WINDOWS

 real 0m0.019s
 user 0m0.004s
 sys 0m0.012s
 # iptables -I OUTPUT -d 172.17.0.65 -j DROP
 # time ls /mnt # This 'ls' cannot be interrupted
 ls: cannot access /mnt: Host is down

 real 4m51.668s
 user 0m0.004s
 sys 0m0.016s
 # time ls /mnt # This 'ls' and all others after can be interrupted
 ls: cannot access /mnt: Host is down

 real 0m10.014s
 user 0m0.008s
 sys 0m0.004s

I see these messages in syslog:

 kernel: [ 1625.552044] CIFS VFS: Server fsrv has not responded in 300
seconds. Reconnecting...
 kernel: [ 1655.509422] CIFS VFS: Unexpected lookup error -112

 ...

 And I can not see any timeout options for mount.cifs (except acl timeout).
So, the actual questions are: 1) is there a way to avoid these hangs
(analog of 'intr'?) and 2) how can I reduce this unreachable-host timeout
(analog of 'timeo'?)? Maybe there are some variables in the sources?

Thanks.

-- 
Best regards,
Sergey Urushkin
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux