Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 2019 21:20:40 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350186 - head/sbin/fsck_ffs
Message-ID:  <201907202120.x6KLKe02023499@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Sat Jul 20 21:20:40 2019
New Revision: 350186
URL: https://svnweb.freebsd.org/changeset/base/350186

Log:
  When running with journaled soft updates, some updated inodes were not
  having their check hashes recomputed which resulted in spurious inode
  check-hash errors when the system came back up after a crash.
  
  Reported by:  Alan Somers
  Sponsored by: Netflix

Modified:
  head/sbin/fsck_ffs/suj.c

Modified: head/sbin/fsck_ffs/suj.c
==============================================================================
--- head/sbin/fsck_ffs/suj.c	Sat Jul 20 21:10:27 2019	(r350185)
+++ head/sbin/fsck_ffs/suj.c	Sat Jul 20 21:20:40 2019	(r350186)
@@ -431,17 +431,28 @@ ino_dirty(ino_t ino)
 	struct iblkhd *hd;
 	struct suj_cg *sc;
 	ufs2_daddr_t blk;
+	int off;
 
 	blk = ino_to_fsba(fs, ino);
 	sc = cg_lookup(ino_to_cg(fs, ino));
 	iblk = sc->sc_lastiblk;
 	if (iblk && iblk->ib_blk == blk) {
+		if (fs->fs_magic == FS_UFS2_MAGIC) {
+			off = ino_to_fsbo(fs, ino);
+			ffs_update_dinode_ckhash(fs,
+			    &((struct ufs2_dinode *)iblk->ib_buf)[off]);
+		}
 		iblk->ib_dirty = 1;
 		return;
 	}
 	hd = &sc->sc_iblkhash[SUJ_HASH(fragstoblks(fs, blk))];
 	LIST_FOREACH(iblk, hd, ib_next) {
 		if (iblk->ib_blk == blk) {
+			if (fs->fs_magic == FS_UFS2_MAGIC) {
+				off = ino_to_fsbo(fs, ino);
+				ffs_update_dinode_ckhash(fs,
+				    &((struct ufs2_dinode *)iblk->ib_buf)[off]);
+			}
 			iblk->ib_dirty = 1;
 			return;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907202120.x6KLKe02023499>