From 73880eef77badd196d2c4d219498f27da955b596 Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Thu, 9 Oct 2025 16:31:53 +0800 Subject: [PATCH] fix: ignore e2fsck errors if retcode < 4 (#23490) Co-authored-by: Qiu Jian --- pkg/hostman/diskutils/fsutils/fsutils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/hostman/diskutils/fsutils/fsutils.go b/pkg/hostman/diskutils/fsutils/fsutils.go index 91bf2d0190..c5562e4b64 100644 --- a/pkg/hostman/diskutils/fsutils/fsutils.go +++ b/pkg/hostman/diskutils/fsutils/fsutils.go @@ -360,8 +360,10 @@ func (d *SFsutilDriver) FsckExtFs(fpath string) bool { log.Debugf("Exec command: %v", []string{"e2fsck", "-f", "-p", fpath}) retCode, stdout, stderr, err := d.ExecInputWait("e2fsck", []string{"-f", "-p", fpath}, nil) if err != nil { - log.Errorf("exec e2fsck failed %s", err) - return false + log.Errorf("exec e2fsck error %s retcode %d stdout %s stderr %s", err, retCode, stdout, stderr) + if retCode >= 4 { + return false + } } if retCode < 4 { return true