public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 1/6] isolation, util: Fold close_open_files() into isolate_initial()
Date: Thu, 16 Jul 2026 15:06:10 +1000	[thread overview]
Message-ID: <alhmnx_H4ch-PVvm@zatzit> (raw)
In-Reply-To: <20260715091223.17cdf9f9@elisabeth>

[-- Attachment #1: Type: text/plain, Size: 2204 bytes --]

On Wed, Jul 15, 2026 at 09:12:23AM +0200, Stefano Brivio wrote:
> On Tue, 14 Jul 2026 19:29:21 +1000
> David Gibson <david@gibson.dropbear.id.au> 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

Fixed.

> > 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.

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()'?

> 
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> 
> 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.

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-07-16  5:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  9:29 [PATCH 0/6] Fix bug 215 and some related issues with fd handling David Gibson
2026-07-14  9:29 ` [PATCH 1/6] isolation, util: Fold close_open_files() into isolate_initial() David Gibson
2026-07-15  7:12   ` Stefano Brivio
2026-07-16  5:06     ` David Gibson [this message]
2026-07-14  9:29 ` [PATCH 2/6] isolation, conf: Set c->fd_tap from eary parse of --fd David Gibson
2026-07-15  7:12   ` Stefano Brivio
2026-07-16  5:12     ` David Gibson
2026-07-14  9:29 ` [PATCH 3/6] conf: Make conf_tap_fd() operate more like conf_mode() David Gibson
2026-07-14  9:29 ` [PATCH 4/6] isolation: Move --fd descriptor to a number of our choosing David Gibson
2026-07-14  9:29 ` [PATCH 5/6] main: Ensure fds 0-2 are populated David Gibson
2026-07-14  9:29 ` [PATCH 6/6] passt: *Always* close pidfile_fd, not just when daemonizing David Gibson
2026-07-15 16:39 ` [PATCH 0/6] Fix bug 215 and some related issues with fd handling Stefano Brivio
2026-07-16  5:25   ` David Gibson
2026-07-16  7:22     ` Stefano Brivio
2026-07-16  7:49       ` David Gibson
2026-07-16  8:02         ` Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alhmnx_H4ch-PVvm@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).