]> www.infradead.org Git - users/jedix/linux-maple.git/commit
locks: have flock_lock_file take an inode pointer instead of a filp
authorJeff Layton <jeff.layton@primarydata.com>
Sat, 11 Jul 2015 10:43:02 +0000 (06:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Oct 2015 00:51:59 +0000 (09:51 +0900)
commit0bdb53e1b4b3d99acb7579cf68ffdaee9ebb4e4f
treef4d31592778f589cd0ac9bd0db286f96a3d23058
parent23a0f8cd351ed6908c24273a174c8c2bd807134f
locks: have flock_lock_file take an inode pointer instead of a filp

commit bcd7f78d078ff6197715c1ed070c92aca57ec12c upstream.

...and rename it to better describe how it works.

In order to fix a use-after-free in NFS, we need to be able to remove
locks from an inode after the filp associated with them may have already
been freed. flock_lock_file already only dereferences the filp to get to
the inode, so just change it so the callers do that.

All of the callers already pass in a lock request that has the fl_file
set properly, so we don't need to pass it in individually. With that
change it now only dereferences the filp to get to the inode, so just
push that out to the callers.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Reviewed-by: "J. Bruce Fields" <bfields@fieldses.org>
Tested-by: "J. Bruce Fields" <bfields@fieldses.org>
Cc: William Dauchy <william@gandi.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/locks.c