From 0c08ecdff3dfdaf6db5e882c8cd816f354284ab3 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Fri, 10 Apr 2020 23:58:07 +0000 Subject: [PATCH] Inode check-hash errors were being reported after system crashes. Trace the cause down to journalled soft updates recovery code in fsck failing to recompute the check-hash after updating an inode. As inode check-hash was first introduced to UFS in FreeBSD 13, there is no need to MFC this commit. Reported by: Chuck Silvers Sponsored by: Netflix --- sbin/fsck_ffs/suj.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index 1090b450046d..e1e3da19e195 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -1622,6 +1622,7 @@ ino_trunc(ino_t ino, off_t size) } DIP_SET(ip, di_blocks, fsbtodb(fs, totalfrags)); DIP_SET(ip, di_size, size); + ino_dirty(ino); /* * If we've truncated into the middle of a block or frag we have * to zero it here. Otherwise the file could extend into @@ -1959,6 +1960,7 @@ ino_unlinked(void) mode = DIP(ip, di_mode) & IFMT; inon = DIP(ip, di_freelink); DIP_SET(ip, di_freelink, 0); + ino_dirty(ino); /* * XXX Should this be an errx? */