From c376c8363f9644aea3dd024f21576699c4901cf2 Mon Sep 17 00:00:00 2001 From: mckusick Date: Sat, 15 Dec 2018 17:58:42 +0000 Subject: [PATCH] Must set ip->i_effnlink = ip->i_nlink to avoid a soft updates "panic: softdep_update_inodeblock: bad link count" when releasing a partially initialized vnode after an inode check-hash failure. Reported by: Gary Jennejohn Reported by: Peter Holm (pho) Sponsored by: Netflix --- sys/ufs/ffs/ffs_subr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 2891c8d8fe96..81b1bf99e9d2 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -127,6 +127,7 @@ ffs_load_inode(struct buf *bp, struct inode *ip, struct fs *fs, ino_t ino) *((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ino)); ip->i_mode = dip1->di_mode; ip->i_nlink = dip1->di_nlink; + ip->i_effnlink = dip1->di_nlink; ip->i_size = dip1->di_size; ip->i_flags = dip1->di_flags; ip->i_gen = dip1->di_gen; @@ -138,6 +139,7 @@ ffs_load_inode(struct buf *bp, struct inode *ip, struct fs *fs, ino_t ino) *dip2 = *((struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, ino)); ip->i_mode = dip2->di_mode; ip->i_nlink = dip2->di_nlink; + ip->i_effnlink = dip2->di_nlink; ip->i_size = dip2->di_size; ip->i_flags = dip2->di_flags; ip->i_gen = dip2->di_gen;