vfs: stop clearing close on exec when closing a fd
authorMateusz Guzik <mguzik@redhat.com>
Tue, 3 Oct 2017 10:58:14 +0000 (12:58 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 5 Nov 2017 23:58:06 +0000 (18:58 -0500)
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 <mguzik@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/file.c

index 1fc7fbbb4510ffa4f99ae2b5f6bb45003a01a366..9d047bd046b03df5dc2e855adead48febb35c5e9 100644 (file)
--- 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);