diff options
author | Sachin Prabhu <sprabhu@redhat.com> | 2010-03-10 10:28:40 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-03-17 15:07:16 -0400 |
commit | ee860b6a650360c91f5d5f9a94262aad9be90015 (patch) | |
tree | 745d678c30f4bcb6bd3306b39f9b2d1869481cef /fs | |
parent | a3d3203e4bb40f253b1541e310dc0f9305be7c84 (diff) |
[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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/locks.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/locks.c b/fs/ocfs2/locks.c index 544ac6245175..b5cb3ede9408 100644 --- a/fs/ocfs2/locks.c +++ b/fs/ocfs2/locks.c | |||
@@ -133,7 +133,7 @@ int ocfs2_lock(struct file *file, int cmd, struct file_lock *fl) | |||
133 | 133 | ||
134 | if (!(fl->fl_flags & FL_POSIX)) | 134 | if (!(fl->fl_flags & FL_POSIX)) |
135 | return -ENOLCK; | 135 | return -ENOLCK; |
136 | if (__mandatory_lock(inode)) | 136 | if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) |
137 | return -ENOLCK; | 137 | return -ENOLCK; |
138 | 138 | ||
139 | return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl); | 139 | return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl); |