CIFS: Fix VFS lock usage for oplocked files
authorPavel Shilovsky <piastry@etersoft.ru>
Tue, 27 Mar 2012 11:36:15 +0000 (15:36 +0400)
committerSteve French <sfrench@us.ibm.com>
Sat, 31 Mar 2012 22:30:48 +0000 (17:30 -0500)
commitb5efb978469d152c2c7c0a09746fb0bfc6171868
tree18d46e1ef3bdf9bbb2df7f8e72b0c1e2ac2919fd
parentfa2a4519cb6ad94224eb56a1341fff570fd44ea1
CIFS: Fix VFS lock usage for oplocked files

We can deadlock if we have a write oplock and two processes
use the same file handle. In this case the first process can't
unlock its lock if another process blocked on the lock in the
same time.

Fix this by removing lock_mutex protection from waiting on a
blocked lock and protect only posix_lock_file call.

Cc: stable@kernel.org
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/file.c