Patch by hannken@ to fix a bug which has been introduced with 1.71.

The kernel crashed with uvm fault when mounting an ados file system.
This commit is contained in:
phx 2015-11-18 22:06:25 +00:00
parent ed7c71fc9a
commit c835c55cd9

View File

@ -1,4 +1,4 @@
/* $NetBSD: advfsops.c,v 1.74 2015/04/20 13:44:16 riastradh Exp $ */
/* $NetBSD: advfsops.c,v 1.75 2015/11/18 22:06:25 phx Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.74 2015/04/20 13:44:16 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.75 2015/11/18 22:06:25 phx Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -369,9 +369,12 @@ adosfs_statvfs(struct mount *mp, struct statvfs *sbp)
int
adosfs_vget(struct mount *mp, ino_t an, struct vnode **vpp)
{
u_long block;
int error;
error = vcache_get(mp, &an, sizeof(an), vpp);
block = an;
KASSERT(block == an);
error = vcache_get(mp, &block, sizeof(block), vpp);
if (error)
return error;
error = vn_lock(*vpp, LK_EXCLUSIVE);
@ -394,7 +397,7 @@ adosfs_loadvnode(struct mount *mp, struct vnode *vp,
struct adosfsmount *amp;
struct anode *ap;
struct buf *bp;
ino_t an;
u_long an;
char *nam, *tmp;
int namlen, error;