Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Oct 2001 14:45:53 -0700 (PDT)
From:      David Wolfskill <david@catwhisker.org>
To:        current@freebsd.org, jlemon@flugsvamp.com
Cc:        david@catwhisker.org, kuriyama@imgsrc.co.jp
Subject:   Re: panic: vrele: missed vn_close
Message-ID:  <200110242145.f9OLjrY46481@bunrab.catwhisker.org>
In-Reply-To: <20011024151252.F75389@prism.flugsvamp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>Date: Wed, 24 Oct 2001 15:12:52 -0500
>From: Jonathan Lemon <jlemon@flugsvamp.com>

>>     I suspect that this is the problem with the devfs/console code.

>Ugh.  Probably.  The console code tries to remember what flag was
>used from the open, but doesn't use that flag during close.

>Here's an (untested) patch - essentially it forces the FWRITE flag
>always on, to avoid this problem.   Possibly the right thing to do
>is to used a fixed set of flags to open the console, and completely
>ignore the user's specified mode.

OK; that patch seems to have needed a small tweak -- using FWRITE
implies that it's defined, so I need to include sys/fcntl.h; cvs diff
follows my uname ouput:

FreeBSD m147.whistle.com 5.0-CURRENT FreeBSD 5.0-CURRENT #146: Wed Oct 24 14:28:45 PDT 2001     root@m147.whistle.com:/common/C/obj/usr/src/sys/LAPTOP_30W  i386

Index: sys/kern/tty_cons.c
===================================================================
RCS file: /cvs/freebsd/src/sys/kern/tty_cons.c,v
retrieving revision 1.93
diff -u -r1.93 tty_cons.c
--- sys/kern/tty_cons.c	23 Oct 2001 20:25:50 -0000	1.93
+++ sys/kern/tty_cons.c	24 Oct 2001 21:19:23 -0000
@@ -41,6 +41,7 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/fcntl.h>
 #include <sys/conf.h>
 #include <sys/cons.h>
 #include <sys/kernel.h>
@@ -365,7 +366,7 @@
 {
 	struct cn_device *cnd;
 
-	openflag = flag;
+	openflag = flag | FWRITE;	/* XXX */
 	cn_is_open = 1;			/* console is logically open */
 	if (cn_mute)
 		return (0);
@@ -382,7 +383,7 @@
 	STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
 		if (cnd->cnd_vp == NULL)
 			continue; 
-		vn_close(cnd->cnd_vp, mode, td->td_proc->p_ucred, td);
+		vn_close(cnd->cnd_vp, openflag, td->td_proc->p_ucred, td);
 		cnd->cnd_vp = NULL;
 	}
 	cn_is_open = 0;


Anyway, I'm up & running multi-user on today's -CURRENT.  I wouldn't
take this as proof that the patch is correct, but it's a definite
improvement in behavior....  :-)

Thanks,
david
-- 
David H. Wolfskill				david@catwhisker.org
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110242145.f9OLjrY46481>