]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
file: Factor files_lookup_fd_locked out of fcheck_files
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 20 Nov 2020 23:14:25 +0000 (17:14 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jun 2024 12:52:48 +0000 (14:52 +0200)
commit9080557c56cd673941675f38805356f7f72949fa
tree396d466b7f341c318f394f113f0cfe0a747368f1
parentddb21f9984209b2c502ed28698918975528721f5
file: Factor files_lookup_fd_locked out of fcheck_files

[ Upstream commit 120ce2b0cd52abe73e8b16c23461eb14df5a87d8 ]

To make it easy to tell where files->file_lock protection is being
used when looking up a file create files_lookup_fd_locked.  Only allow
this function to be called with the file_lock held.

Update the callers of fcheck and fcheck_files that are called with the
files->file_lock held to call files_lookup_fd_locked instead.

Hopefully this makes it easier to quickly understand what is going on.

The need for better names became apparent in the last round of
discussion of this set of changes[1].

[1] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbRPqyQ@mail.gmail.com
Link: https://lkml.kernel.org/r/20201120231441.29911-8-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/file.c
fs/locks.c
fs/proc/fd.c
include/linux/fdtable.h