From: Mateusz Guzik Date: Tue, 3 Oct 2017 10:58:14 +0000 (+0200) Subject: vfs: stop clearing close on exec when closing a fd X-Git-Tag: v4.19~2150^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5297908270549b734c7c2556745e2385b6d4941d;p=platform%2Fkernel%2Flinux-rpi.git vfs: stop clearing close on exec when closing a fd Codepaths allocating a fd always make sure the bit is set/unset depending on flags, thus clearing on close is redundant. Signed-off-by: Mateusz Guzik Signed-off-by: Al Viro --- diff --git a/fs/file.c b/fs/file.c index 1fc7fbb..9d047bd 100644 --- a/fs/file.c +++ b/fs/file.c @@ -631,7 +631,6 @@ int __close_fd(struct files_struct *files, unsigned fd) if (!file) goto out_unlock; rcu_assign_pointer(fdt->fd[fd], NULL); - __clear_close_on_exec(fd, fdt); __put_unused_fd(files, fd); spin_unlock(&files->file_lock); return filp_close(file, files);