<< repaired << " repaired, "
<< (errors + warnings - (int)repaired) << " remaining in "
<< duration << " seconds" << dendl;
- return errors - (int)repaired;
+
+ // In non-repair mode we should return error count only as
+ // it indicates if store status is OK.
+ // In repair mode both errors and warnings are taken into account
+ // since repaired counter relates to them both.
+ return repair ? errors + warnings - (int)repaired : errors;
}
/// methods to inject various errors fsck can repair
r = bluestore.quick_fix();
}
if (r < 0) {
- cerr << "error from fsck: " << cpp_strerror(r) << std::endl;
+ cerr << action << " failed: " << cpp_strerror(r) << std::endl;
exit(EXIT_FAILURE);
} else if (r > 0) {
- cerr << action << " found " << r << " error(s)" << std::endl;
+ cerr << action << " status: remaining " << r << " error(s) and warning(s)" << std::endl;
exit(EXIT_FAILURE);
} else {
cout << action << " success" << std::endl;
return 1;
}
if (r > 0) {
- cerr << "fsck found " << r << " errors" << std::endl;
+ cerr << "fsck status: " << r << " remaining error(s) and warning(s)" << std::endl;
return 1;
}
- cout << "fsck found no errors" << std::endl;
+ cout << "fsck success" << std::endl;
return 0;
}
if (op == "repair" || op == "repair-deep") {
return 1;
}
if (r > 0) {
- cerr << "repair found " << r << " errors" << std::endl;
+ cerr << "repair status: " << r << " remaining error(s) and warning(s)" << std::endl;
return 1;
}
- cout << "repair found no errors" << std::endl;
+ cout << "repair success" << std::endl;
return 0;
}
if (op == "mkfs") {