Don't explicitly set vp->v_size and then call uvm_vnp_setsize(). This is

not only unnecessary, but trips a kernel assertion introduced in r1.85 of
uvm/uvm_vnode.c.
This commit is contained in:
rumble 2007-09-08 19:19:37 +00:00
parent 0b6fb31125
commit f25f34f4c0
2 changed files with 6 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: efs_vfsops.c,v 1.9 2007/08/06 21:10:24 pooka Exp $ */
/* $NetBSD: efs_vfsops.c,v 1.10 2007/09/08 19:19:37 rumble Exp $ */
/*
* Copyright (c) 2006 Stephen M. Rumble <rumble@ephemeral.org>
@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: efs_vfsops.c,v 1.9 2007/08/06 21:10:24 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: efs_vfsops.c,v 1.10 2007/09/08 19:19:37 rumble Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -400,7 +400,6 @@ efs_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
}
efs_sync_dinode_to_inode(eip);
vp->v_size = eip->ei_size;
if (ino == EFS_ROOTINO && !S_ISDIR(eip->ei_mode)) {
printf("efs: root inode (%lu) is not a directory!\n",
@ -442,7 +441,7 @@ efs_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
return (EIO);
}
uvm_vnp_setsize(vp, vp->v_size);
uvm_vnp_setsize(vp, eip->ei_size);
*vpp = vp;
KASSERT(VOP_ISLOCKED(vp));

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysvbfs_vfsops.c,v 1.15 2007/07/31 21:14:18 pooka Exp $ */
/* $NetBSD: sysvbfs_vfsops.c,v 1.16 2007/09/08 19:19:37 rumble Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vfsops.c,v 1.15 2007/07/31 21:14:18 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vfsops.c,v 1.16 2007/09/08 19:19:37 rumble Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -387,10 +387,9 @@ sysvbfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
} else {
vp->v_type = VREG;
}
vp->v_size = bfs_file_size(inode);
genfs_node_init(vp, &sysvbfs_genfsops);
uvm_vnp_setsize(vp, vp->v_size);
uvm_vnp_setsize(vp, bfs_file_size(inode));
*vpp = vp;
return 0;