fix: ignore e2fsck errors if retcode < 4 (#23490)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2025-10-09 16:31:53 +08:00
committed by GitHub
co-authored by Qiu Jian
parent 948f67577f
commit 73880eef77
+4 -2
View File
@@ -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