From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 47E3291669 for ; Thu, 15 Feb 2024 09:26:55 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 27B11EDE9 for ; Thu, 15 Feb 2024 09:26:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 15 Feb 2024 09:26:24 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 0B1134833A for ; Thu, 15 Feb 2024 09:26:23 +0100 (CET) Date: Thu, 15 Feb 2024 09:26:22 +0100 (CET) From: Dietmar Maurer To: Proxmox Backup Server development discussion , Gabriel Goller Message-ID: <826626143.2158.1707985582359@webmail.proxmox.com> In-Reply-To: <20240214095207.37024-1-g.goller@proxmox.com> References: <20240214095207.37024-1-g.goller@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.6-Rev59 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL 0.357 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 T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [create.rs] Subject: Re: [pbs-devel] [PATCH proxmox-backup v2 1/2] fix #4975: client: ignore E2BIG error flag 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: , X-List-Received-Date: Thu, 15 Feb 2024 08:26:55 -0000 comments inline, > + Err(Errno::E2BIG) => { > + match skip_e2big_xattr { > + true => return Ok(()), > + false => { > + return Err(format_err!("{} (try --skip-e2big-xattr)", Errno::E2BIG.to_string())); I now wonder why you do not simply use "bail!"? diff --git a/pbs-client/src/pxar/create.rs b/pbs-client/src/pxar/create.rs index a31086e2..75376c0c 100644 --- a/pbs-client/src/pxar/create.rs +++ b/pbs-client/src/pxar/create.rs @@ -7,7 +7,7 @@ use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, OwnedFd, RawFd}; use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; -use anyhow::{bail, Context, Error, format_err}; +use anyhow::{bail, Context, Error}; use futures::future::BoxFuture; use futures::FutureExt; use nix::dir::Dir; @@ -841,7 +841,7 @@ fn get_xattr_fcaps_acl( match skip_e2big_xattr { true => return Ok(()), false => { - return Err(format_err!("{} (try --skip-e2big-xattr)", Errno::E2BIG.to_string())); + bail!("{} (try --skip-e2big-xattr)", Errno::E2BIG.to_string()); } }; } @@ -875,7 +875,7 @@ fn get_xattr_fcaps_acl( match skip_e2big_xattr { true => return Ok(()), false => { - return Err(format_err!("{} (try --skip-e2big-xattr)", Errno::E2BIG.to_string())); + bail!("{} (try --skip-e2big-xattr)", Errno::E2BIG.to_string()); } }; }