Don't drop vnode refs until we are done with the mount.

This commit is contained in:
ad 2008-01-07 16:08:46 +00:00
parent ee83c29560
commit eb4920235a
1 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_syscalls_20.c,v 1.23 2007/12/20 23:02:45 dsl Exp $ */
/* $NetBSD: vfs_syscalls_20.c,v 1.24 2008/01/07 16:08:46 ad Exp $ */
/*
* Copyright (c) 1989, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.23 2007/12/20 23:02:45 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.24 2008/01/07 16:08:46 ad Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_43.h"
@ -154,7 +154,6 @@ compat_20_sys_statfs(struct lwp *l, const struct compat_20_sys_statfs_args *uap,
return error;
mp = nd.ni_vp->v_mount;
vrele(nd.ni_vp);
sbuf = malloc(sizeof(*sbuf), M_TEMP, M_WAITOK);
if ((error = dostatvfs(mp, sbuf, l, 0, 1)) != 0)
@ -162,6 +161,7 @@ compat_20_sys_statfs(struct lwp *l, const struct compat_20_sys_statfs_args *uap,
error = vfs2fs(SCARG(uap, buf), sbuf);
done:
vrele(nd.ni_vp);
free(sbuf, M_TEMP);
return error;
}
@ -297,12 +297,13 @@ compat_20_sys_fhstatfs(struct lwp *l, const struct compat_20_sys_fhstatfs_args *
if ((error = VFS_FHTOVP(mp, (struct fid*)&fh.fh_fid, &vp)))
return (error);
mp = vp->v_mount;
vput(vp);
VOP_UNLOCK(vp, 0);
sbuf = malloc(sizeof(*sbuf), M_TEMP, M_WAITOK);
if ((error = VFS_STATVFS(mp, sbuf)) != 0)
goto out;
error = vfs2fs(SCARG(uap, buf), sbuf);
out:
vrele(vp);
free(sbuf, M_TEMP);
return error;
}