From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GceywWCz; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 4A2B75A0269 for ; Wed, 15 Jul 2026 09:12:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784099549; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sDTF36kpdQYNoYBGvN/NzB3Iw1vOFbICO35qKHIg9NM=; b=GceywWCzc8JPiA8gfI/0Abzf8lbE0mt+L7R2xk+/wEEYm6sycJVV9KUI9lvopJQ0uzpF/v 1O0bWAYRDe/DFlntNmiJju15CKocH/WTa6GhmK/IuTQtWrQ9YpT5SW7IZG6yPV9vr4fqbn iR1XunlhRIn2ABFroM4k1J3ATNsOpkA= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-416-iVGjuOoDPN2dzEKcVg-_WQ-1; Wed, 15 Jul 2026 03:12:27 -0400 X-MC-Unique: iVGjuOoDPN2dzEKcVg-_WQ-1 X-Mimecast-MFC-AGG-ID: iVGjuOoDPN2dzEKcVg-_WQ_1784099546 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-493d742c668so41279925e9.2 for ; Wed, 15 Jul 2026 00:12:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784099546; x=1784704346; h=date:content-transfer-encoding:content-type:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=sDTF36kpdQYNoYBGvN/NzB3Iw1vOFbICO35qKHIg9NM=; b=SgWuuNIRyrQhQmtFEcqTbveBI7KdwSmCIq8HZ6QfGceUPmkveO8oTB2g2qsUUd/hKL xOWQYPRpYkOZ0ZMNPCjCAIpH+9T9ClpemXb0q4gpO1keW9dles4kyrG2qn9E2T5w+/7q uXQ53mF+VWs83x0uPkIaLWzM6n1qa+XyUALRzT/J/QXprVzJ87P7BlQN1JoLJTRlfMeH pwwu/lK3FzVCizg1G91yjx4CWP7Gt8C2IQYA1PQY/CItusxkaaQMoI7gIEaXvihOXtK7 bK148WJJa/0q0oGE82q9Wi6L/ZwQxS5b2QGdTlbAvSBpr8Va14vMDkJU2/AN7+MMuhCm g0dw== X-Gm-Message-State: AOJu0YzLQMWyIzIKIFxEI6oE6Uyn9xMqLUMPKktS1ORhwFPibIfoeRdB LPXHKiiQOnVRf/egIxMaHJCcK8Yx1GqnYXtL858IpJcUhUY5rbtBOYKTPExOqa0yttmV/BuyeqR 8ZfV0vKIZXF9SRaPdVUJNG6fBTRyK7pFY+q0cA12DeBkyvIqQrZCzvA== X-Gm-Gg: AfdE7ckfXPVP9VU/HSu8cqt/UNaxlfsG/v63sjtZkacJh4JX3tNCSlGyHpanmdm7WHu c76rNDFW2XJ1Css0FYfr5NM7m0cApjRLyVNy7s8kdTSsKNCG8z6lf8yK1lbLnifRrFbTlUPxa3B q6sla/xGaHMcnfQa7GB6L36Mg2CezbVDt7JuXO5yx8ocu2ltlxftpoNnTlInF+wjhMaQneEa/+A 7SkNUF4T9QjjKLOF1AMfEAzXOZSu2GVAqqdUGcq7CMiFs3zWSEwk+9611Ab1oWWE1zDam7vLlyV pe9/NCWo0kSqzGaE2qiTggUhFkelyroaTCT3ampYfvAsYcpitIHKA+nD/iCwNk54onHwhZTb4Qe JhIF0slgAFYypd8ECoR1L5A== X-Received: by 2002:a05:600c:a20b:b0:494:ca0e:5da0 with SMTP id 5b1f17b1804b1-495158d700dmr51415575e9.15.1784099545794; Wed, 15 Jul 2026 00:12:25 -0700 (PDT) X-Received: by 2002:a05:600c:a20b:b0:494:ca0e:5da0 with SMTP id 5b1f17b1804b1-495158d700dmr51415355e9.15.1784099545349; Wed, 15 Jul 2026 00:12:25 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f4634e5c3sm13477950f8f.1.2026.07.15.00.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 00:12:24 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 1/6] isolation, util: Fold close_open_files() into isolate_initial() Message-ID: <20260715091223.17cdf9f9@elisabeth> In-Reply-To: <20260714092926.2881848-2-david@gibson.dropbear.id.au> References: <20260714092926.2881848-1-david@gibson.dropbear.id.au> <20260714092926.2881848-2-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Wed, 15 Jul 2026 09:12:23 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: DdWRHypWoQAMseX4qceJYf0roh79p2BQohPqdP6JUB8_1784099546 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: HLB2C6TB2FJMH3JJER7TBTJNSR6XNPR2 X-Message-ID-Hash: HLB2C6TB2FJMH3JJER7TBTJNSR6XNPR2 X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 14 Jul 2026 19:29:21 +1000 David Gibson wrote: > Most functions in util.c are, well, utilities, that are useful in a bunch > of places. close_open_files(), however, is very specific, it's only called > from isolate_initial(), and really only can be called from there - it's Nit: its > logic encodes a very specific action we want to take at that point. > > So, remove it from util.c and fold into isolate_initial(). To me this doesn't actually look like an improvement (well, of course, otherwise I would have structured commit 09603cab28f9 ("passt, util: Close any open file that the parent might have leaked") differently) exactly because close_open_files() is very specific and does exactly that one thing, contributing to a shorter version of isolate_initial(). Now, I realise that we're pretty far from "fixing" https://bugs.passt.top/show_bug.cgi?id=31, but still, isolate_initial() in its current form looks much more digestible than a version with thirty-three lines added on top. It currently has a specific role and that's conceptually a separated operation, regardless of the fact it has a single caller. On top of that, the function comment to close_open_files() disappears this way, because it has no natural place anymore. But I think that was rather useful. > Signed-off-by: David Gibson By the way, should you respin, you could probably Cc: Ammar as he volunteered to review this kind of series. I would also suggest Cc'ing reporters (and marking them as such when doable). -- Stefano