8000 (via norrietaylor): fix(diag): check debugfs exit status in volume_fallback harvest by macroscopeapp[bot] · Pull Request #890 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion crates/minimal/src/diag/guest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,20 @@ pub async fn volume_fallback(
match result {
Ok(Ok(out)) => {
let harvested = harvest_dir(w, &dest_dir, &tmp.path().join("logs")).await;
if harvested == 0 {
// Only treat as successful if debugfs succeeded (zero exit) AND files
// were harvested; a nonzero exit means the dump may be partial/corrupt.
if !out.status.success() {
let code = out.status.code().unwrap_or(-1);
let first_err = String::from_utf8_lossy(&out.stderr)
.lines()
.next()
.unwrap_or("no stderr")
.to_string();
w.skip(
&dest_dir,
format!("debugfs exited with code {code} ({first_err}); {hint}"),
);
} else if harvested == 0 {
let first_err = String::from_utf8_lossy(&out.stderr)
.lines()
.next()
Expand Down
0