all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	 Gabriel Goller <g.goller@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v2 1/2] fix #4975: client: ignore E2BIG error flag
Date: Thu, 15 Feb 2024 09:26:22 +0100 (CET)	[thread overview]
Message-ID: <826626143.2158.1707985582359@webmail.proxmox.com> (raw)
In-Reply-To: <20240214095207.37024-1-g.goller@proxmox.com>

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());
                     }
                 };
             }




  parent reply	other threads:[~2024-02-15  8:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14  9:52 Gabriel Goller
2024-02-14  9:52 ` [pbs-devel] [PATCH proxmox-backup v2 2/2] print full anyhow error context Gabriel Goller
2024-02-15  9:33   ` Dietmar Maurer
2024-02-15  8:26 ` Dietmar Maurer [this message]
2024-02-15  9:37 ` [pbs-devel] applied: [PATCH proxmox-backup v2 1/2] fix #4975: client: ignore E2BIG error flag Dietmar Maurer

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=826626143.2158.1707985582359@webmail.proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=g.goller@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal