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))
@ -405,6 +405,10 @@ lfs_writevnodes(struct lfs *fs, struct mount *mp, struct segment *sp, int op)
goto loop;
}
if (vp->v_type == VNON) {
continue;
}
ip = VTOI(vp);
if ((op == VN_DIROP && !(vp->v_flag & VDIROP)) ||
(op != VN_DIROP && op != VN_CLEAN && (vp->v_flag & VDIROP))) {
@ -417,10 +421,6 @@ lfs_writevnodes(struct lfs *fs, struct mount *mp, struct segment *sp, int op)
continue;
}
if (vp->v_type == VNON) {
continue;
}
if (op == VN_CLEAN && ip->i_number != LFS_IFILE_INUM
&& vp != fs->lfs_flushvp
&& !(ip->i_flag & IN_CLEANING)) {