in lfs_writefile, check v_type==VNON earlier.

to avoid null dereference with DEBUG_LFS_VERBOSE.
This commit is contained in:
yamt 2002-12-14 11:54:47 +00:00
parent 304244f5d7
commit e5ea55e4ea

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_segment.c,v 1.84 2002/12/13 14:40:02 yamt Exp $ */
/* $NetBSD: lfs_segment.c,v 1.85 2002/12/14 11:54:47 yamt Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.84 2002/12/13 14:40:02 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.85 2002/12/14 11:54:47 yamt Exp $");
#define ivndebug(vp,str) printf("ino %d: %s\n",VTOI(vp)->i_number,(str))
@ -404,6 +404,10 @@ lfs_writevnodes(struct lfs *fs, struct mount *mp, struct segment *sp, int op)
printf("lfs_writevnodes: starting over\n");
goto loop;
}
if (vp->v_type == VNON) {
continue;
}
ip = VTOI(vp);
if ((op == VN_DIROP && !(vp->v_flag & VDIROP)) ||
@ -416,10 +420,6 @@ lfs_writevnodes(struct lfs *fs, struct mount *mp, struct segment *sp, int op)
vndebug(vp,"empty");
continue;
}
if (vp->v_type == VNON) {
continue;
}
if (op == VN_CLEAN && ip->i_number != LFS_IFILE_INUM
&& vp != fs->lfs_flushvp