From: Matthew Dillon Date: Wed, 23 Oct 2013 01:53:15 +0000 (-0700) Subject: kernel - Remove debugging kprintf() from procfs X-Git-Tag: v3.7.0~88 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/e09db544b831aa5ca10fbacf86387d23c518f067 kernel - Remove debugging kprintf() from procfs * Remove a procfs console warning that is not longer applicable. The procfs filesystem topology is never quite in sync with reality and races between lookups and existing processes are to be expected. --- diff --git a/sys/vfs/procfs/procfs_vnops.c b/sys/vfs/procfs/procfs_vnops.c index 5aba1add2a..6e6a6003c4 100644 --- a/sys/vfs/procfs/procfs_vnops.c +++ b/sys/vfs/procfs/procfs_vnops.c @@ -1102,15 +1102,20 @@ procfs_readlink(struct vop_readlink_args *ap) len = ksnprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); return (uiomove(buf, len, ap->a_uio)); - /* - * There _should_ be no way for an entire process to disappear - * from under us... - */ case Pfile: + /* + * procfs's directory topology is somewhat asynchronous from + * reality so it is possible for pid requests to race exiting + * processes. In this situation, bit 31 is set in + * pfs->pfs_pid which guarantees that pfs_pfind() will return + * NULL. + * + * It is also possible to catch a process in the middle of + * an exit sequence so various fields might wind up being + * NULL that are not normally NULL. + */ procp = pfs_pfind(pfs->pfs_pid); if (procp == NULL || procp->p_ucred == NULL) { - kprintf("procfs_readlink: pid %d disappeared\n", - pfs->pfs_pid); pfs_pdone(procp); return (uiomove("unknown", sizeof("unknown") - 1, ap->a_uio));