freebsd-dev/sbin/fsck_ffs
David Bright 469759f8e4 Exit fsck_ffs with non-zero status when file system is not repaired.
When the fsck_ffs program cannot fully repair a file system, it will
output the message PLEASE RERUN FSCK. However, it does not exit with a
non-zero status in this case (contradicting the man page claim that it
"exits with 0 on success, and >0 if an error occurs."  The fsck
rc-script (when running "fsck -y") tests the status from fsck (which
passes along the exit status from fsck_ffs) and issues a "stop_boot"
if the status fails. However, this is not effective since fsck_ffs can
return zero even on (some) errors. Effectively, it is left to a later
step in the boot process when the file systems are mounted to detect
the still-unclean file system and stop the boot.

This change modifies fsck_ffs so that when it cannot fully repair the
file system and issues the PLEASE RERUN FSCK message it also exits
with a non-zero status.

While here, the fsck_ffs man page has also been updated to document
the failing exit status codes used by fsck_ffs. Previously, only exit
status 7 was documented. Some of these exit statuses are tested for in
the fsck rc-script, so they are clearly depended upon and deserve
documentation.

Reviewed by:	mckusick, vangyzen, jilles (manpages)
MFC after:	1 week
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D13862
2018-01-15 19:25:11 +00:00
..
dir.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
ea.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
fsck_ffs.8 Exit fsck_ffs with non-zero status when file system is not repaired. 2018-01-15 19:25:11 +00:00
fsck.h Exit fsck_ffs with non-zero status when file system is not repaired. 2018-01-15 19:25:11 +00:00
fsutil.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
gjournal.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
globs.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
inode.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
main.c Exit fsck_ffs with non-zero status when file system is not repaired. 2018-01-15 19:25:11 +00:00
Makefile sbin: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:33:01 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pass1.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass1b.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass2.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass3.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass4.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass5.c Report CG checksum mismatches. These errors are non-fatal. The 2018-01-14 16:55:14 +00:00
setup.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
suj.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
utilities.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00