]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - fs/namei.c
locks: fix locks_mandatory_locked to respect file-private locks
authorJeff Layton <jlayton@redhat.com>
Mon, 10 Mar 2014 13:54:15 +0000 (09:54 -0400)
committerJeff Layton <jlayton@redhat.com>
Mon, 31 Mar 2014 12:24:43 +0000 (08:24 -0400)
commitd7a06983a01a33605191c0766857b832ac32a2b6
treed6a0f83579e0d7a20a235ddb568d935fe54b24fb
parent90478939dce096ed5b239cad16237dca0a59d66f
locks: fix locks_mandatory_locked to respect file-private locks

As Trond pointed out, you can currently deadlock yourself by setting a
file-private lock on a file that requires mandatory locking and then
trying to do I/O on it.

Avoid this problem by plumbing some knowledge of file-private locks into
the mandatory locking code. In order to do this, we must pass down
information about the struct file that's being used to
locks_verify_locked.

Reported-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: J. Bruce Fields <bfields@redhat.com>
fs/locks.c
fs/namei.c
include/linux/fs.h
mm/mmap.c
mm/nommu.c