From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 8AD751FF2D7 for ; Fri, 12 Jul 2024 09:44:15 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id ADC623DBFA; Fri, 12 Jul 2024 09:44:38 +0200 (CEST) Date: Fri, 12 Jul 2024 09:44:05 +0200 From: Christoph Heiss To: Christian Ebner Message-ID: References: <20240711170723.1115046-1-c.heiss@proxmox.com> <793904308.2594.1720769823342@webmail.proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <793904308.2594.1720769823342@webmail.proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.017 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [docs.rs] Subject: Re: [pbs-devel] [PATCH proxmox] sys: file: use renameat2() from `nix` crate X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Cc: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" 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 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