fix an error case.

This commit is contained in:
chs 2002-01-26 08:32:05 +00:00
parent 2a8b52def1
commit 1b454dbb4f
2 changed files with 6 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_balloc.c,v 1.15 2001/11/30 07:06:19 chs Exp $ */
/* $NetBSD: ext2fs_balloc.c,v 1.16 2002/01/26 08:32:06 chs Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ext2fs_balloc.c,v 1.15 2001/11/30 07:06:19 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: ext2fs_balloc.c,v 1.16 2002/01/26 08:32:06 chs Exp $");
#if defined(_KERNEL_OPT)
#include "opt_uvmhist.h"
@ -394,7 +394,6 @@ ext2fs_balloc_range(vp, off, len, cred, flags)
UVMHIST_LOG(ubchist, "vp %p off 0x%x len 0x%x u_size 0x%x",
vp, off, len, vp->v_size);
error = 0;
oldeof = vp->v_size;
eof = MAX(oldeof, off + len);
UVMHIST_LOG(ubchist, "new eof 0x%x", eof,0,0,0);
@ -415,7 +414,7 @@ ext2fs_balloc_range(vp, off, len, cred, flags)
VM_PROT_READ, 0, PGO_SYNCIO | PGO_PASTEOF);
if (error) {
UVMHIST_LOG(ubchist, "getpages %d", error,0,0,0);
goto errout;
return error;
}
for (i = 0; i < npages; i++) {
UVMHIST_LOG(ubchist, "got pgs[%d] %p", i, pgs[i],0,0);
@ -447,7 +446,6 @@ ext2fs_balloc_range(vp, off, len, cred, flags)
* if we got an error, free any pages we created past the old eob.
*/
errout:
simple_lock(&vp->v_interlock);
for (i = 0; i < npages; i++) {
pgs[i]->flags &= ~PG_RDONLY;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_inode.c,v 1.32 2001/12/27 01:48:38 fvdl Exp $ */
/* $NetBSD: ufs_inode.c,v 1.33 2002/01/26 08:32:05 chs Exp $ */
/*
* Copyright (c) 1991, 1993
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.32 2001/12/27 01:48:38 fvdl Exp $");
__KERNEL_RCSID(0, "$NetBSD: ufs_inode.c,v 1.33 2002/01/26 08:32:05 chs Exp $");
#include "opt_quota.h"
@ -215,7 +215,7 @@ ufs_balloc_range(vp, off, len, cred, flags)
error = VOP_GETPAGES(vp, pagestart, pgs, &npages, 0,
VM_PROT_READ, 0, PGO_SYNCIO|PGO_PASTEOF);
if (error) {
goto out;
return error;
}
simple_lock(&uobj->vmobjlock);
uvm_lock_pageq();
@ -249,7 +249,6 @@ ufs_balloc_range(vp, off, len, cred, flags)
* (since they now have backing store) and unbusy them.
*/
out:
simple_lock(&uobj->vmobjlock);
for (i = 0; i < npages; i++) {
pgs[i]->flags &= ~PG_RDONLY;