From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751960AbdJCK6X (ORCPT ); Tue, 3 Oct 2017 06:58:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57694 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbdJCK6U (ORCPT ); Tue, 3 Oct 2017 06:58:20 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B52DAC04AC6B Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=mguzik@redhat.com From: Mateusz Guzik To: Eric Dumazet , Al Viro Cc: mszeredi@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] vfs: stop clearing close on exec when closing a fd Date: Tue, 3 Oct 2017 12:58:14 +0200 Message-Id: <1507028295-9353-2-git-send-email-mguzik@redhat.com> In-Reply-To: <1507028295-9353-1-git-send-email-mguzik@redhat.com> References: <1507028295-9353-1-git-send-email-mguzik@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 03 Oct 2017 10:58:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/file.c | 1 - 1 file changed, 1 deletion(-) 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); -- 1.8.3.1