9p: Skip check for mandatory locks when unlocking
commitb5cc76ffd6a95b4281580c7bc0dbfca70c23369e
authorSachin Prabhu <sprabhu@redhat.com>
Sat, 13 Mar 2010 15:03:55 +0000 (13 09:03 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:47:58 +0000 (26 07:47 -0700)
tree27d5f658e8b45d03d98de4709ef731b999132bcc
parent53d737879cbbe3886e26f155007dbc148aec1cb6
9p: Skip check for mandatory locks when unlocking

commit f78233dd44a110c574fe760ad6f9c1e8741a0d00 upstream.

While investigating a bug, I came across a possible bug in v9fs. The
problem is similar to the one reported for NFS by ASANO Masahiro in
http://lkml.org/lkml/2005/12/21/334.

v9fs_file_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. Such a lock will be skipped
during unlock and the machine will end up with a BUG in
locks_remove_flock().

v9fs_file_lock() should skip the check for mandatory locks when
unlocking a file.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/9p/vfs_file.c