summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2009-02-14 21:12:24 +0000
committermarcus <marcus@FreeBSD.org>2009-02-14 21:12:24 +0000
commit130b8c14ad2ecacb715fe63397e5e867a7a7c7ec (patch)
tree4e5f853dc5209d738ef75f47a0961225e65b0b6c
parent900dd11db2994e229a8ab40f7431f0d125b97b86 (diff)
downloadFreeBSD-src-130b8c14ad2ecacb715fe63397e5e867a7a7c7ec.zip
FreeBSD-src-130b8c14ad2ecacb715fe63397e5e867a7a7c7ec.tar.gz
Change two KASSERTS to printfs and simple returns. Stress testing has
revealed that a process' current working directory can be VBAD if the directory is removed. This can trigger a panic when procstat -f PID is run. Tested by: pho Discovered by: phobot Reviewed by: kib Approved by: kib
-rw-r--r--sys/kern/kern_descrip.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index cfa2cb6..f6909dd 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -2532,7 +2532,12 @@ export_vnode_for_osysctl(struct vnode *vp, int type,
kif->kf_fd = type;
kif->kf_type = KF_TYPE_VNODE;
/* This function only handles directories. */
- KASSERT(vp->v_type == VDIR, ("export_vnode_for_osysctl: vnode not directory"));
+ if (vp->v_type != VDIR) {
+ printf("export_vnode_for_osysctl: vnode not directory: %d\n",
+ vp->v_type);
+ vrele(vp);
+ return (ENOTDIR);
+ }
kif->kf_vnode_type = KF_VTYPE_VDIR;
/*
@@ -2779,7 +2784,12 @@ export_vnode_for_sysctl(struct vnode *vp, int type,
kif->kf_fd = type;
kif->kf_type = KF_TYPE_VNODE;
/* This function only handles directories. */
- KASSERT(vp->v_type == VDIR, ("export_vnode_for_sysctl: vnode not directory"));
+ if (vp->v_type != VDIR) {
+ printf("export_vnode_for_sysctl: vnode not directory: %d\n",
+ vp->v_type);
+ vrele(vp);
+ return (ENOTDIR);
+ }
kif->kf_vnode_type = KF_VTYPE_VDIR;
/*
OpenPOWER on IntegriCloud