Bug 233560 - fsck_ffs(8): pfatal doesn't prevent marking filesystem clean
Summary: fsck_ffs(8): pfatal doesn't prevent marking filesystem clean
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-27 12:27 UTC by Edward Tomasz Napierala
Modified: 2018-11-28 00:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edward Tomasz Napierala freebsd_committer freebsd_triage 2018-11-27 12:27:24 UTC
When run "by hand", as opposed to preen mode, calls to pfatal(8) don't result in the filesystem being marked dirty.  Sample session:

% doas fsck -y /dev/md0s2a              
** /dev/md0s2a
** Last Mounted on /releng/12-armv7-BEAGLEBONE-release/usr/obj/usr/src/arm.armv7/release/ufs
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
MISSING '.'  I=3360  OWNER=root MODE=40755
SIZE=16384 MTIME=Nov  2 03:27 2018 
DIR=?

UNEXPECTED SOFT UPDATE INCONSISTENCY
CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS if_xl.ko.debug

UNEXPECTED SOFT UPDATE INCONSISTENCY
MISSING '..'  I=3360  OWNER=root MODE=40755
SIZE=16384 MTIME=Nov  2 03:27 2018 
DIR=?

UNEXPECTED SOFT UPDATE INCONSISTENCY
CANNOT FIX, SECOND ENTRY IN DIRECTORY CONTAINS zfs.ko.debug

UNEXPECTED SOFT UPDATE INCONSISTENCY
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
SUMMARY INFORMATION BAD
SALVAGE? yes

BLK(S) MISSING IN BIT MAPS
SALVAGE? yes

22686 files, 349061 used, 399242 free (450 frags, 49849 blocks, 0.1% fragmentation)

***** FILE SYSTEM IS CLEAN *****

***** FILE SYSTEM WAS MODIFIED *****
Comment 1 Kirk McKusick freebsd_committer freebsd_triage 2018-11-28 00:40:20 UTC
The pfatal call perhaps should be called preenfatal. It is only fatal when running in preen mode. In this example, fsck was not able to add "." and ".." to the broken directory, but the filesystem was not inconsistant, so was marked clean. Or put another way, the filesystem is safe to use, so it is marked clean.