diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2020-12-09 15:42:57 -0600 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2020-12-10 12:39:00 -0600 |
commit | 878f12dbb8f514799d126544d59be4d2675caac3 (patch) | |
tree | ec5a16bc7ca1fd440c8aa9f2bf29c21cd3189c62 /fs/fs_pin.c | |
parent | 3650b228f83adda7e5ee532e2b90429c03f7b9ec (diff) |
exec: Don't open code get_close_on_exec
Al Viro pointed out that using the phrase "close_on_exec(fd,
rcu_dereference_raw(current->files->fdt))" instead of wrapping it in
rcu_read_lock(), rcu_read_unlock() is a very questionable
optimization[1].
Once wrapped with rcu_read_lock()/rcu_read_unlock() that phrase
becomes equivalent the helper function get_close_on_exec so
simplify the code and make it more robust by simply using
get_close_on_exec.
[1] https://lkml.kernel.org/r/20201207222214.GA4115853@ZenIV.linux.org.uk
Suggested-by: Al Viro <viro@ftp.linux.org.uk>
Link: https://lkml.kernel.org/r/87k0tqr6zi.fsf_-_@x220.int.ebiederm.org
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/fs_pin.c')
0 files changed, 0 insertions, 0 deletions