最近一台Linux服务器报了一堆
CIFS VFS: Unexpected lookup error -20
CIFS VFS: Unexpected lookup error -20
CIFS VFS: Unexpected lookup error -20
CIFS VFS: No response for cmd 50 mid 7244
CIFS VFS: No response to cmd 4 mid 47810
CIFS VFS: Send error in Close = -11
CIFS VFS: No response for cmd 50 mid 47818
CIFS VFS: No response for cmd 50 mid 47822
CIFS VFS: No response to cmd 5 mid 15521
CIFS VFS: Send error in Flush = -11
CIFS VFS: Write2 ret -11, wrote 0
CIFS VFS: Send error in Close = -9
CIFS VFS: No response for cmd 50 mid 15526
CIFS VFS: No response for cmd 50 mid 15530
错误。
没有头绪, 查了一下google,
/sbin/modprobe cifs
/bin/echo 0 > /proc/fs/cifs/OplockEnabled
/bin/echo 0 > /proc/fs/cifs/LookupCacheEnabled
转载如下 :
On a few systems, I've noticed CIFS mounts have a tendency to lock up the system when transferring large files, or a shitload of small ones in quick succession. When this happens, the system may or may not completely lock up, and lines like these will appear in your syslog:
Aug 1 22:58:16 dreadnought kernel: CIFS VFS: No response to cmd 46 mid 25661
Aug 1 22:58:16 dreadnought kernel: CIFS VFS: Send error in read = -11
Aug 1 22:58:16 dreadnought kernel: CIFS VFS: No response for cmd 50 mid 25664
Aug 1 22:58:16 dreadnought kernel: CIFS VFS: No response to cmd 47 mid 25663
Aug 1 22:58:20 dreadnought kernel: CIFS VFS: No response to cmd 47 mid 25662
Aug 1 22:58:20 dreadnought kernel: CIFS VFS: Write2 ret -11, written = 0
Aug 1 22:58:20 dreadnought kernel: CIFS VFS: Send error in read = -9
Aug 1 22:58:20 dreadnought kernel: CIFS VFS: Write2 ret -9, written = 0
Aug 1 22:59:52 dreadnought kernel: CIFS VFS: No writable handles for inode
Aug 1 23:00:29 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:00:36 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:01:16 dreadnought kernel: CIFS VFS: No writable handles for inode
Aug 1 23:02:28 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:03:23 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:03:44 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:05:35 dreadnought kernel: CIFS VFS: No writable handles for inode
Aug 1 23:06:18 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:06:35 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:06:46 dreadnought kernel: CIFS VFS: No writable handles for inode
Aug 1 23:06:46 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:07:02 dreadnought kernel: CIFS VFS: close with pending writes
Aug 1 23:07:46 dreadnought kernel: CIFS VFS: server not respondingI found a workaround which involves disabling Opportunistic Locking. This will have a small performance impact, but at least the thing wont hang up and use 100% CPU for no goddamn reason. Yes, this article has an angry tone, because this issue has eaten way too much of my time today.
To disable Opportunistic Locking, you have to set the contents of the file "/proc/fs/cifs/OplockEnabled" to 0. This file only exists after the cifs module has been loaded, and will be replaced if the module is unloaded and reloaded. Thus, I configured my /etc/rc.local script (use whatever equivalent your distro has to a startup script) to both load the cifs module and set the contents of said file:
# cifs client workaround
modprobe cifs
echo 0 > /proc/fs/cifs/OplockEnabledThere you go.
回复 :
My function use cifs protocol to transfer file and it usually occur “CIFS VFS: Send error in read = -11
” error.
I searched the cifs reference and get a ways to resovle it.
http://pserver.samba.org/samba/ftp/cifs-cvs/linux-cifs-client-guide.pdf
”
Performance Considerations
Server speed, server disk speed and network speed can constrain the overall performance of a cifs
mount, but in some cases, client client configuration settings can be changed to increase performance:
1) size of file write (wsize). The Linux CIFS client usually sends 56K writes (14 pages) and is
limited to 56K maximum unless mounted forcedirectio.
2) size of file read (rsize). The Linux CIFS client usually sends 16K reads (4 pages). Since CIFS
large network buffers are about 16K in size by default, increasing the rsize would have little
effect unless the setting of module load parameter CIFSMaxBufSize (via insmod) also is
increased.
”
I just lower the block of data what i want to write.
you can use command “modinfo cifs” to get the cifs read or write buffer size and buffersize scope.
【参考】
http://blog.dhampir.no/content/cifs-vfs-no-response-for-cmd-n-mid
http://cweiske.de/tagebuch/Timed%20permission%20problems%20on%20CIFS.htm