svn commit: r350186 - head/sbin/fsck_ffs

Kirk McKusick mckusick at FreeBSD.org
Sat Jul 20 21:20:40 UTC 2019


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;
 		}


More information about the svn-src-all mailing list