]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kcmp: In kcmp_epoll_target use fget_task
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 20 Nov 2020 23:14:21 +0000 (17:14 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jun 2024 12:52:47 +0000 (14:52 +0200)
commitfe1722255ebd9b7fa3602ea1e86cf79f8844d43e
tree451af09776c6171817355217bd8eb83f2c3a332e
parentba7aac19b4be916b68067bfe09b1b648dd0bdd8f
kcmp: In kcmp_epoll_target use fget_task

[ Upstream commit f43c283a89a7dc531a47d4b1e001503cf3dc3234 ]

Use the helper fget_task and simplify the code.

As well as simplifying the code this removes one unnecessary increment of
struct files_struct.  This unnecessary increment of files_struct.count can
result in exec unnecessarily unsharing files_struct and breaking posix
locks, and it can result in fget_light having to fallback to fget reducing
performance.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
v1: https://lkml.kernel.org/r/20200817220425.9389-4-ebiederm@xmission.com
Link: https://lkml.kernel.org/r/20201120231441.29911-4-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>
kernel/kcmp.c