1BangBang 2016-12-27 16:38:45 +08:00 2
Previously, the NFS Lock Manager (NLM) did not resend blocking lock requests after NFSv3 server reboot recovery. As a consequence, when an application was running on a NFSv3 mount and requested a blocking lock, the application received an "-ENOLCK" error. This patch ensures that NLM always resends blocking lock requests after the grace period has expired.
The NFSv4 code uses byte range locks to simulate the flock() function, which is used to apply or remove an exclusive advisory lock on an open file. However, using the NFSv4 byte range locks precludes a possibility to open a file with read-only permissions and subsequently to apply an exclusive advisory lock on the file. A previous patch broke a mechanism used to verify the mode of the open file. As a consequence, the system became unresponsive and the system logs filled with a "kernel: nfs4_reclaim_open_state: Lock reclaim failed!" error message if the file was open with read-only permissions and an attempt to apply an exclusive advisory lock was made. This update modifies the NFSv4 code to check the mode of the open file before attempting to apply the exclusive advisory lock. The "-EBADF" error code is returned if the type of the lock does not match the file mode.
利益相关：前 nfs qe 实习生
2016-12-27 17:05:59 +08:00
Ubuntu: Linux yy07 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Centos: Linux yy08 2.6.18-398.el5 #1 SMP Tue Sep 16 20:50:52 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
3BangBang 2016-12-27 17:15:16 +08:00 1
@yiyiwa 因为 linux 下面 nfs server v3/v4 & client v3/v4/v4.1 都是放在内核实现的。
2016-12-28 13:16:59 +08:00
确定不是内核问题, 刚才升级到 4.9 了, 还是一样.
2017-01-13 15:28:40 +08:00
问题搞定了, 在 autofs 中加入 nolock 就可以了,