Skip to content

Commit 4df1ec4

Browse files
committed
log: warn when ignoring extended attributes error
1 parent 4fac21c commit 4df1ec4

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

crates/core/src/backend/ignore.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use chrono::TimeZone;
1616
use chrono::{DateTime, Local, Utc};
1717
use derive_setters::Setters;
1818
use ignore::{overrides::OverrideBuilder, DirEntry, Walk, WalkBuilder};
19-
use log::{debug, warn};
19+
use log::warn;
2020
#[cfg(not(windows))]
2121
use nix::unistd::{Gid, Group, Uid, User};
2222

@@ -488,7 +488,7 @@ fn list_extended_attributes(path: &Path) -> RusticResult<Vec<ExtendedAttribute>>
488488
/// * [`IgnoreErrorKind::ErrorXattr`] - if Xattr couldn't be listed or couldn't be read
489489
#[cfg(all(not(windows), not(target_os = "openbsd")))]
490490
fn list_extended_attributes(path: &Path) -> RusticResult<Vec<ExtendedAttribute>> {
491-
Ok(xattr::list(path)
491+
xattr::list(path)
492492
.map_err(|err| IgnoreErrorKind::ErrorXattr {
493493
path: path.to_path_buf(),
494494
source: err,
@@ -504,7 +504,7 @@ fn list_extended_attributes(path: &Path) -> RusticResult<Vec<ExtendedAttribute>>
504504
.unwrap(),
505505
})
506506
})
507-
.collect::<RusticResult<Vec<ExtendedAttribute>>>()?)
507+
.collect::<RusticResult<Vec<ExtendedAttribute>>>()
508508
}
509509

510510
/// Maps a [`DirEntry`] to a [`ReadSourceEntry`].
@@ -568,14 +568,7 @@ fn map_entry(
568568

569569
let extended_attributes = match list_extended_attributes(entry.path()) {
570570
Err(e) => {
571-
// TODO - discuss this log:
572-
// Most probably that if Xattr read failure happens for one file,
573-
// it will also happen for every file in the same subdirectory.
574-
//
575-
// The end result would be a real flood of errors.
576-
// For this reason, I propose to have this log at "debug" level
577-
// so it's not transparent, but doesn't impact a "lambda" use case of rustic.
578-
debug!("ignoring error: {e}\n");
571+
warn!("ignoring error: {e}\n");
579572
vec![]
580573
}
581574
Ok(xattr_list) => xattr_list,

0 commit comments

Comments
 (0)