]> git.baikalelectronics.ru Git - kernel.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)
committerJeff Layton <jeff.layton@primarydata.com>
Mon, 13 Jul 2015 10:29:11 +0000 (06:29 -0400)
commit47f9fccd99417bec2c5fd265ca020e707101b37d
tree67e8a76ebf041787e4894883ce72733b048ccd9c
parentf4d0a98b9d2719953dde2250f53c9f16d42854a7
locks: have flock_lock_file take an inode pointer instead of a filp

...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>
fs/locks.c