Date: Thu, 6 Jul 2006 08:50:22 GMT From: Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/99758: chown/chmod pty slave side in kernel Message-ID: <200607060850.k668oMXV071210@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/99758; it has been noted by GNATS. From: Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> To: Robert Watson <rwatson@FreeBSD.org> Cc: freebsd-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: kern/99758: chown/chmod pty slave side in kernel Date: Thu, 06 Jul 2006 17:42:20 +0900 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?200607060850.k668oMXV071210>