[pbs-devel] [PATCH proxmox-backup v2 1/2] fix #4975: client: ignore E2BIG error flag

Dietmar Maurer dietmar at proxmox.com
Thu Feb 15 09:26:22 CET 2024


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




More information about the pbs-devel mailing list