Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0800c5f7 authored by ASANO Masahiro's avatar ASANO Masahiro Committed by Linus Torvalds
Browse files

[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: default avatarASANO Masahiro <masano@tnes.nec.co.jp>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d6f02913
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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))