Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Jul 2006 17:42:20 +0900
From:      Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        freebsd-bugs@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org
Subject:   Re: kern/99758: chown/chmod pty slave side in kernel
Message-ID:  <200607060842.k668gK2I021382@smr00.gssm.otsuka.tsukuba.ac.jp>
In-Reply-To: Your message of "Wed, 05 Jul 2006 12:08:54 %2B0100"
References:  <200607040242.k642g6BG099462@www.freebsd.org> <20060705120748.F18236@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson writes:
> ...
> The tty_pts implementation in 7-CURRENT does the same, except more so, by 
> forcing revocation of the pty on last close.  Unfortunately, this triggers 
> bugs in devfs.  Your help in getting the 7.x pts implementation up and runnin
> g 
> would be much appreciated.  Take a look at src/sys/kern/tty_pts.c.

 Thank you for interested in my patch.

 I don't have a machine to run 7-current now,
 so just read `src/sys/kern/tty_pts.c'.

 Is make_dev()/destroy_dev() problem specific to pts implementaition?
 What happens when destroy_devl() of src/sys/kern/kern_conf.c is modified as

--- kern_conf.c	Thu Jul  6 17:11:27 2006
+++ kern_conf.c	Thu Jul  6 17:38:51 2006
@@ -682,6 +682,10 @@
 	}
 	dev->si_flags &= ~SI_ALIAS;
 
+	if (dev->si_refcount == 0 && dev->si_priv->cdp_inuse > 0) {
+		/* devfs_populate_loop() will free this cdev structure */
+		dev->si_refcount++;
+	}
 	if (dev->si_refcount > 0) {
 		LIST_INSERT_HEAD(&dead_cdevsw.d_devs, dev, si_list);
 	} else {


 I suspect the situation that the cdev structure is freed
 while it is referred to by devfs.



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