Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp599992pxx; Thu, 29 Oct 2020 09:50:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycVCM2DdSR3g6c0B8w7y/Q5HU7Jc+UCdb4emYz8y/LTIsab+qg3DVWMSM5L6f16d0jKf9i X-Received: by 2002:aa7:cc0e:: with SMTP id q14mr4882342edt.326.1603990236435; Thu, 29 Oct 2020 09:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603990236; cv=none; d=google.com; s=arc-20160816; b=eGSemwQB8wrREuCwqx/oTRkuM8sXPMwm6g/M/kRxf23DZFsvMyidwPgYGXgOXLNybQ RrKo9X0+fWbe9mTtl7knuow+UpA0iUA0yRI3Ic2mPemSAdmw0ZW302F5n6Bf1AoroArp w7IuTTtZSoX6FsXsMeyLNEw6DqrYEU3THuqsNhUQUJWFabRU4X/hZUCS2TGH18/9f39s 0sg/MR6Qf52dc+NBLuWBSi1jWuYVQoNO44cnJfRj/GhgBHBwxHvWjAvVbcNuooZlSImd 3a70F3unA0EsFXtfYWrxZ2rFVI66lj+MsKd6dy3aZjnnPUPxkK+Y3Bopgmy3kLHuLfsv t+Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=TwZQ2oN6WxzK0UUncdaVDf1saKXhHV2p2lzyo7kKTGg=; b=uo+BQpmpZJOL616S+4DOKupH9/07vl8QLK2dbt6H00ZcwFlUN0vEQ3wL8PWzS4Qa5M 1R3dxpVD592rdtKm/meWch4U1uwFv4jX+22akFisKq9/uuQAhbLBID4q7Ix4UOz/w8f+ 5h5x5z8VhTUEoqRb/FyCRFJQmj2T+F8Oe3U1oDV6nBkaqghmf7FwGUT7zCwiRHje42Td hKIrE+5utTyTkcNoFUrkY2Rp4Ze3SRfPLKoAg9L+XNviqTclsvl38fvFA2/SzdZV50OM 6xQEvnBTq48Lcz5UnNvsal0WmXS6Oor25PdjXGcSiKssKe2d5I+bRzJOuFsR7A1LS/s+ 7o1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D0TFV20S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si3402074edi.14.2020.10.29.09.50.12; Thu, 29 Oct 2020 09:50:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D0TFV20S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbgJ2Qsq (ORCPT + 99 others); Thu, 29 Oct 2020 12:48:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23931 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727014AbgJ2QsC (ORCPT ); Thu, 29 Oct 2020 12:48:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603990081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TwZQ2oN6WxzK0UUncdaVDf1saKXhHV2p2lzyo7kKTGg=; b=D0TFV20SMf+eCOlXjdnnASI0eVTPpeHSXbq/mFjN82ui1HVC3YVsuW8IGzCZqUa+iy/hAp 2mXu5q8Ti0QgyHweL40kQU3aiifNBeiMlMLWlE2RLeKi90W88YwjEiTcZHuarUVS5WJnSP UyjXxZK4RsrgB3wJ2Rk7XIBGlhdVAb4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-ARyo9KBvOw-DHqiZaF1ENw-1; Thu, 29 Oct 2020 12:47:57 -0400 X-MC-Unique: ARyo9KBvOw-DHqiZaF1ENw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 451A6807321; Thu, 29 Oct 2020 16:47:56 +0000 (UTC) Received: from localhost (ovpn-113-77.ams2.redhat.com [10.36.113.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B96B56EF68; Thu, 29 Oct 2020 16:47:55 +0000 (UTC) From: Giuseppe Scrivano To: Christian Brauner Cc: linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, containers@lists.linux-foundation.org Subject: Re: [PATCH v2 0/2] fs, close_range: add flag CLOSE_RANGE_CLOEXEC References: <20201019102654.16642-1-gscrivan@redhat.com> <20201029153859.numo2fc42vgf3ppk@wittgenstein> Date: Thu, 29 Oct 2020 17:47:53 +0100 In-Reply-To: <20201029153859.numo2fc42vgf3ppk@wittgenstein> (Christian Brauner's message of "Thu, 29 Oct 2020 16:38:59 +0100") Message-ID: <87mu05vv0m.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christian, Christian Brauner writes: > On Mon, Oct 19, 2020 at 12:26:52PM +0200, Giuseppe Scrivano wrote: >> When the new flag is used, close_range will set the close-on-exec bit >> for the file descriptors instead of close()-ing them. >> >> It is useful for e.g. container runtimes that want to minimize the >> number of syscalls used after a seccomp profile is installed but want >> to keep some fds open until the container process is executed. >> >> v1->v2: >> * move close_range(..., CLOSE_RANGE_CLOEXEC) implementation to a separate function. >> * use bitmap_set() to set the close-on-exec bits in the bitmap. >> * add test with rlimit(RLIMIT_NOFILE) in place. >> * use "cur_max" that is already used by close_range(..., 0). > > I'm picking this up for some testing, thanks > Christian thanks! I've addressed the comments you had for v2 and pushed them here[1] but I've not sent yet v3 as I was waiting for a feedback from Al whether using bitmap_set() is fine. Regards, Giuseppe [1] https://github.com/giuseppe/linux/tree/close-range-cloexec