This is a note to let you know that I've just added the patch titled file: Replace ksys_close with close_fd to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: file-replace-ksys_close-with-close_fd.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 8cd670c5a346a92e1e984c2e972154a37da0c909 Author: Eric W. Biederman <ebiederm@xxxxxxxxxxxx> Date: Fri Nov 20 17:14:39 2020 -0600 file: Replace ksys_close with close_fd [ Upstream commit 1572bfdf21d4d50e51941498ffe0b56c2289f783 ] Now that ksys_close is exactly identical to close_fd replace the one caller of ksys_close with close_fd. [1] https://lkml.kernel.org/r/20200818112020.GA17080@xxxxxxxxxxxxx Suggested-by: Christoph Hellwig <hch@xxxxxxxxxxxxx> Link: https://lkml.kernel.org/r/20201120231441.29911-22-ebiederm@xxxxxxxxxxxx Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c index 322b7dfb4ea01..5bf781ea6d676 100644 --- a/fs/autofs/dev-ioctl.c +++ b/fs/autofs/dev-ioctl.c @@ -4,9 +4,10 @@ * Copyright 2008 Ian Kent <raven@xxxxxxxxxx> */ +#include <linux/module.h> #include <linux/miscdevice.h> #include <linux/compat.h> -#include <linux/syscalls.h> +#include <linux/fdtable.h> #include <linux/magic.h> #include <linux/nospec.h> @@ -289,7 +290,7 @@ static int autofs_dev_ioctl_closemount(struct file *fp, struct autofs_sb_info *sbi, struct autofs_dev_ioctl *param) { - return ksys_close(param->ioctlfd); + return close_fd(param->ioctlfd); } /* diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 0bc3dd86f9e50..1ea422b1a9f1c 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -1320,18 +1320,6 @@ static inline long ksys_ftruncate(unsigned int fd, loff_t length) return do_sys_ftruncate(fd, length, 1); } -extern int close_fd(unsigned int fd); - -/* - * In contrast to sys_close(), this stub does not check whether the syscall - * should or should not be restarted, but returns the raw error codes from - * close_fd(). - */ -static inline int ksys_close(unsigned int fd) -{ - return close_fd(fd); -} - extern long do_sys_truncate(const char __user *pathname, loff_t length); static inline long ksys_truncate(const char __user *pathname, loff_t length)