From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202606 header.b=TJ4uxngA; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 85C415A026D for ; Thu, 16 Jul 2026 07:45:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1784180742; bh=NUfH2VlHBwdfEzHwua37xB1vlxybMZHAl5howf9gD7o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TJ4uxngA81cIn26LliSRCQ9Cpc7aSFDtk9kkNK1UX9xL8D5wkLQTO5lTKFDbr2AYP VICV906pcOli+dnB7sZDgBFh15XVbQKE7jS1aGe7p0HY6O3Hs+OIGczP9DVt/MN20N fTNCSXpLSJPLQjeZEcoaJbtDj8P6YxnHTYG6c5RUgb2ekNolxAuyPKf66Ozm/ertE8 yxQGv/ahrqaIMmXhe43y4rLdBU4lkNoYBOV0dCljxbHMPZNvylUYFNMJCMwJK78Y49 ZVpJPO4WbdqP+pQu3u/jgG29hg8NRfSxn6f29Msqpag28yY/vk6WQPRGyrdsaCGqKH MMdZnL7BJnCBg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4h12866hd1z4w9j; Thu, 16 Jul 2026 15:45:42 +1000 (AEST) Date: Thu, 16 Jul 2026 15:06:10 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 1/6] isolation, util: Fold close_open_files() into isolate_initial() Message-ID: References: <20260714092926.2881848-1-david@gibson.dropbear.id.au> <20260714092926.2881848-2-david@gibson.dropbear.id.au> <20260715091223.17cdf9f9@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Vxye5RUKE3Mo1Z5L" Content-Disposition: inline In-Reply-To: <20260715091223.17cdf9f9@elisabeth> Message-ID-Hash: W56JT6WVCSAF26XCOEGXNZLKP56FR44N X-Message-ID-Hash: W56JT6WVCSAF26XCOEGXNZLKP56FR44N X-MailFrom: dgibson@gandalf.ozlabs.org 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: --Vxye5RUKE3Mo1Z5L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 15, 2026 at 09:12:23AM +0200, Stefano Brivio wrote: > On Tue, 14 Jul 2026 19:29:21 +1000 > David Gibson wrote: >=20 > > Most functions in util.c are, well, utilities, that are useful in a bun= ch > > of places. close_open_files(), however, is very specific, it's only ca= lled > > from isolate_initial(), and really only can be called from there - it's >=20 > Nit: its Fixed. > > logic encodes a very specific action we want to take at that point. > >=20 > > So, remove it from util.c and fold into isolate_initial(). >=20 > 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(). >=20 > Now, I realise that we're pretty far from "fixing" > https://bugs.passt.top/show_bug.cgi?id=3D31, 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. Fair points. I still think the case for putting this code in isolate.c rather than util.c is strong. How would you feel about moving close_open_files() to isolate.c, but not folding it into isolate_initial(). Maybe 'isolate_fds()'? >=20 > > Signed-off-by: David Gibson >=20 > 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). Oh, good point. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --Vxye5RUKE3Mo1Z5L Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmpYZrsACgkQzQJF27ox 2Gftkw/9En6lNwF3RVEKvZ4w7FJom9TQDSEw1KiDMTYHAbO1eJfcKhgfOdj6xZ5p a0d1aO5qRGVcsKHRp0OoOufTmE9K/RWV+tTfPMXzYYAK1QUf58em8J0D6KyhwSMb 2CgXOSi7v8mosOCWbFhtGXJYbVQ/sKegkTGLOAAbQ0mcfHWqEZT8op6/oIert8Cs gw4nM/7NGmVsnsucEDJ+xLTN/TCwN3QmRmDygeKXR4EZy23cAhU33MIc8G4yo/x1 IurVilfZyEEz4KYOxsGRQ7pKlaDvmh5TKdvZKFz6T/n3kLhEASWkOMIefPG5tobj b+2nA8oyX5huFl7Scn2N3uoOQcfoUqJ66hJ2JsavBq9iE+aQj99+XTA3KqkNC5tn bPIdPTtjdnBVYYeyt7EUqGJHZ8fiQcbUcLQF97cY4DMu2arim3uQvsVLAn4TRFVT UriZzGGBaF+aCqRik7AaGTwGLg78ZNpHlI8oV/WJIJJ8eTTQrIHSVYQ9uuIL81Pe Ua5vyx0JyCh5y7UHf06SaokAb0QlDL7yh/D8jE0ocjmX8CatzNkBohg6jrp1D3WP 1eA9PkZvK4R92Paew7EsXMzM0rUWsov1hSt49FdXCzeWweN8lUhUNecyRxsCOU8O K9lpo+OrumAIKZJc66mAGwBdcgcJde9o3IMh+Ng9Nk6Ok6bR9WQ= =z8zg -----END PGP SIGNATURE----- --Vxye5RUKE3Mo1Z5L--