From: Christoph Heiss <c.heiss@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>
Cc: Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox] sys: file: use renameat2() from `nix` crate
Date: Fri, 12 Jul 2024 09:44:05 +0200 [thread overview]
Message-ID: <efacy7uhwqc5tsuy2lkntsb4pelljqeb7ltuluzolsqehssd7o@2ua3rntg2z5k> (raw)
In-Reply-To: <793904308.2594.1720769823342@webmail.proxmox.com>
Thanks for the review!
On Fri, Jul 12, 2024 at 09:37:03AM GMT, Christian Ebner wrote:
> one small nit inline:
> > On 11.07.2024 19:07 CEST Christoph Heiss <c.heiss@proxmox.com> wrote:
> > [..]
> > + // some file systems don't support `RENAME_NOREPLACE`
> > // so we just use `link` + `unlink` instead
> > - let result = Errno::result(libc::link(c_file_name.as_ptr(), new_path.as_ptr()));
> > - let _ = libc::unlink(c_file_name.as_ptr());
> > + let result = nix::unistd::linkat(
> > + None,
> > + &temp_file_name,
> > + None,
> > + &path.to_path_buf(),
> > + nix::unistd::LinkatFlags::NoSymlinkFollow,
>
> According to
> https://docs.rs/nix/0.29.0/nix/unistd/type.LinkatFlags.html
> `LinkatFlags` will be deprecated with version 0.28. We currently use
> nix 0.16.1, which already provides the suggested replacment using the
> `AtFlags` https://docs.rs/nix/0.26.1/nix/fcntl/struct.AtFlags.html.
>
> So it would make sense to already use these instead.
Nice catch! I'll send a v2 :^)
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
prev parent reply other threads:[~2024-07-12 7:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 17:07 Christoph Heiss
2024-07-11 17:11 ` Turkijan
2024-07-11 19:39 ` Dietmar Maurer
2024-07-12 7:37 ` Christian Ebner
2024-07-12 7:44 ` Christoph Heiss [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=efacy7uhwqc5tsuy2lkntsb4pelljqeb7ltuluzolsqehssd7o@2ua3rntg2z5k \
--to=c.heiss@proxmox.com \
--cc=c.ebner@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