public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox v2 1/2] sys: fs: set CLOEXEC when creating temp files
Date: Mon, 2 Dec 2024 17:07:41 +0100	[thread overview]
Message-ID: <e5e222c1-7ec4-4f69-853a-a8542fbce809@proxmox.com> (raw)
In-Reply-To: <20241129142801.3334969-1-d.csapak@proxmox.com>

Am 29.11.24 um 15:28 schrieb Dominik Csapak:
> In general we want all open files to have set CLOEXEC since our
> reloading mechanism can basically fork at any moment and we don't want
> newer daemons to carry around old file descriptors, especially lock
> files.
> 
> Since `make_tmp_file` is called by many things (e.g. open_file_locked,
> logrotate, rrd), set O_CLOEXEC with mkostemp.
> 
> This fixes issues with leftover file descriptors e.g. tape backups not
> working because of lingering locks after a reload, or having deleted
> rrd files open.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> changes from v1:
> * introduce mkostemp helper which is similar to nix's mkstemp helper
>   (the code is a copy of mkstemp aside from the call to libcmkostemp +
>   the oflag handling)
> 
>   I did it this way, since we may be able to upstream this, have
>   to look more closer at this though.
> 
>  proxmox-sys/src/fs/file.rs | 25 ++++++++++++++++++++++++-
>  1 file changed, 24 insertions(+), 1 deletion(-)
> 
>

applied both patches with Fabian's R-b, thanks!

I amended the doc-comment and commit message of the second patch a bit
though.


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


      parent reply	other threads:[~2024-12-02 16:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 14:28 [pbs-devel] " Dominik Csapak
2024-11-29 14:28 ` [pbs-devel] [PATCH proxmox v2 2/2] sys: open directories with O_CLOEXEC Dominik Csapak
2024-12-02 14:01   ` Fabian Grünbichler
2024-12-02 14:55     ` Dominik Csapak
2024-12-02 15:03       ` Fabian Grünbichler
2024-12-02 14:02 ` [pbs-devel] [PATCH proxmox v2 1/2] sys: fs: set CLOEXEC when creating temp files Fabian Grünbichler
2024-12-02 16:07 ` Thomas Lamprecht [this message]

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=e5e222c1-7ec4-4f69-853a-a8542fbce809@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal