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;
                }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to