diff options
author | Sachin Prabhu <sprabhu@redhat.com> | 2010-03-11 18:24:45 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2010-03-11 18:17:57 +0100 |
commit | 720e7749279bde0d08684b1bb4e7a2eedeec6394 (patch) | |
tree | 894b5b4695fa6e6a7f86101bad1862a0cd623fe8 /fs | |
parent | GFS2: Allow the number of committed revokes to temporarily be negative (diff) | |
download | linux-720e7749279bde0d08684b1bb4e7a2eedeec6394.tar.xz linux-720e7749279bde0d08684b1bb4e7a2eedeec6394.zip |
GFS2: Skip check for mandatory locks when unlocking
gfs2_lock() will skip locks on file which have 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. Such a lock will be skipped and will result in a BUG in locks_remove_flock().
gfs2_lock() should skip the check for mandatory locks when unlocking a file.
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index a6abbae8a278..e6dd2aec6f82 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -640,7 +640,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) if (!(fl->fl_flags & FL_POSIX)) return -ENOLCK; - if (__mandatory_lock(&ip->i_inode)) + if (__mandatory_lock(&ip->i_inode) && fl->fl_type != F_UNLCK) return -ENOLCK; if (cmd == F_CANCELLK) { |