提交 0800c5f7 编写于 作者: A ASANO Masahiro 提交者: Linus Torvalds

[PATCH] fix posix lock on NFS

NFS client prevents mandatory lock, but there is a flaw on it; Locks are
possibly left if the mode is changed while locking.

This permits unlocking even if the mandatory lock bits are set.
Signed-off-by: NASANO Masahiro <masano@tnes.nec.co.jp>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 d6f02913
......@@ -509,7 +509,8 @@ static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl)
return -EINVAL;
/* No mandatory locks over NFS */
if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID &&
fl->fl_type != F_UNLCK)
return -ENOLCK;
if (IS_GETLK(cmd))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册