summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2005-10-09 19:06:34 +0000
committertegge <tegge@FreeBSD.org>2005-10-09 19:06:34 +0000
commit4422105e30330684d4fc2637fdb05b6849338ba8 (patch)
tree555026dbe4b396719acb05ce9dd087145f372b4c /sys
parentbebf0068f7830fa463e31c6ef97db78c529a9836 (diff)
downloadFreeBSD-src-4422105e30330684d4fc2637fdb05b6849338ba8.zip
FreeBSD-src-4422105e30330684d4fc2637fdb05b6849338ba8.tar.gz
Reinitialize v_type and v_op fields in case vnode has been reused without
reclamation. If the vnode previously was a fifo then v_op would point to ffs_fifoops[12] instead of the expected ffs_vnodeops[12], causing a panic at the end of ffsext_strategy.
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 88f428e..01f636d 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -951,6 +951,11 @@ ffs_valloc(pvp, mode, cred, vpp)
ip->i_din2->di_birthnsec = ts.tv_nsec;
}
ip->i_flag = 0;
+ (*vpp)->v_type = VNON;
+ if (fs->fs_magic == FS_UFS2_MAGIC)
+ (*vpp)->v_op = &ffs_vnodeops2;
+ else
+ (*vpp)->v_op = &ffs_vnodeops1;
return (0);
noinodes:
UFS_UNLOCK(ump);
OpenPOWER on IntegriCloud