mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-16 03:37:05 +00:00
[PATCH] Skip check for mandatory locks when unlocking
ocfs2_lock() will skip locks on file which has mode set to 02666. This is a problem in cases where the mode of the file is changed after a process has obtained a lock on the file. ocfs2_lock() should skip the check for mandatory locks when unlocking a file. Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
This commit is contained in:
parent
a3d3203e4b
commit
ee860b6a65
1 changed files with 1 additions and 1 deletions
|
|
@ -133,7 +133,7 @@ int ocfs2_lock(struct file *file, int cmd, struct file_lock *fl)
|
||||||
|
|
||||||
if (!(fl->fl_flags & FL_POSIX))
|
if (!(fl->fl_flags & FL_POSIX))
|
||||||
return -ENOLCK;
|
return -ENOLCK;
|
||||||
if (__mandatory_lock(inode))
|
if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
|
||||||
return -ENOLCK;
|
return -ENOLCK;
|
||||||
|
|
||||||
return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl);
|
return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue