rework GC traversal error handling
the error message don't make sense with an empty default Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
3e461dec1c
commit
d08cff51a4
@ -395,16 +395,18 @@ impl DataStore {
|
|||||||
}
|
}
|
||||||
let handle_entry_err = |err: walkdir::Error| {
|
let handle_entry_err = |err: walkdir::Error| {
|
||||||
if let Some(inner) = err.io_error() {
|
if let Some(inner) = err.io_error() {
|
||||||
let path = err.path().unwrap_or(Path::new(""));
|
if let Some(path) = err.path() {
|
||||||
match inner.kind() {
|
if inner.kind() == io::ErrorKind::PermissionDenied {
|
||||||
io::ErrorKind::PermissionDenied => {
|
|
||||||
// only allow to skip ext4 fsck directory, avoid GC if, for example,
|
// only allow to skip ext4 fsck directory, avoid GC if, for example,
|
||||||
// a user got file permissions wrong on datastore rsync to new server
|
// a user got file permissions wrong on datastore rsync to new server
|
||||||
if err.depth() > 1 || !path.ends_with("lost+found") {
|
if err.depth() > 1 || !path.ends_with("lost+found") {
|
||||||
bail!("cannot continue garbage-collection safely, permission denied on: {}", path.display())
|
bail!("cannot continue garbage-collection safely, permission denied on: {:?}", path)
|
||||||
}
|
}
|
||||||
},
|
} else {
|
||||||
_ => bail!("unexpected error on datastore traversal: {} - {}", inner, path.display()),
|
bail!("unexpected error on datastore traversal: {} - {:?}", inner, path)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
bail!("unexpected error on datastore traversal: {}", inner)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user