diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2020-11-20 17:14:23 -0600 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2020-12-10 12:39:48 -0600 |
commit | 439be32656035d3239fd56f9b83353ec06cb3b45 (patch) | |
tree | 019377cd0b079b710aded2fdec028ed85016e455 /kernel/configs | |
parent | b48845af0152d790a54b8ab78cc2b7c07485fc98 (diff) | |
download | linux-439be32656035d3239fd56f9b83353ec06cb3b45.tar.bz2 |
proc/fd: In proc_fd_link use fget_task
When discussing[1] exec and posix file locks it was realized that none
of the callers of get_files_struct fundamentally needed to call
get_files_struct, and that by switching them to helper functions
instead it will both simplify their code and remove unnecessary
increments of files_struct.count. Those unnecessary increments can
result in exec unnecessarily unsharing files_struct which breaking
posix locks, and it can result in fget_light having to fallback to
fget reducing system performance.
Simplifying proc_fd_link is a little bit tricky. It is necessary to
know that there is a reference to fd_f ile while path_get is running.
This reference can either be guaranteed to exist either by locking the
fdtable as the code currently does or by taking a reference on the
file in question.
Use fget_task to remove the need for get_files_struct and
to take a reference to file in question.
[1] https://lkml.kernel.org/r/20180915160423.GA31461@redhat.com
Suggested-by: Oleg Nesterov <oleg@redhat.com>
v1: https://lkml.kernel.org/r/20200817220425.9389-8-ebiederm@xmission.com
Link: https://lkml.kernel.org/r/20201120231441.29911-6-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel/configs')
0 files changed, 0 insertions, 0 deletions