Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jul 2006 09:50:23 GMT
From:      Ian Dowse <iedowse@iedowse.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/99758: chown/chmod pty slave side in kernel 
Message-ID:  <200607140950.k6E9oNPI074183@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: Ian Dowse <iedowse@iedowse.com>
To: Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp>
Cc: "Wojciech A. Koszek" <wkoszek@FreeBSD.org>,
    freebsd-gnats-submit@FreeBSD.org, Robert Watson <rwatson@FreeBSD.org>
Subject: Re: kern/99758: chown/chmod pty slave side in kernel 
Date: Fri, 14 Jul 2006 10:45:44 +0100

 In message <200607130915.k6D9F2eg054212@smr00.gssm.otsuka.tsukuba.ac.jp>, Atsuo
  Ohki writes:
 > I achieved a little success.
 > Now (really now!),  pty test of stress2 is running.
 >
 > I modified as follow:
 
 I'm not sure if it is related, but the following old patch had
 solved some issue I was seeing with getty running on USB serial
 ports. Maybe it is a similar issue?
 
 Ian
 
 Index: kern_conf.c
 ===================================================================
 RCS file: /dump/FreeBSD-CVS/src/sys/kern/kern_conf.c,v
 retrieving revision 1.197
 diff -u -r1.197 kern_conf.c
 --- kern_conf.c	12 Jan 2006 19:15:14 -0000	1.197
 +++ kern_conf.c	3 Feb 2006 00:43:20 -0000
 @@ -658,6 +658,7 @@
  		dev->si_flags &= ~SI_CLONELIST;
  	}
  
 +	dev_refl(dev);	/* another thread might dev_rel() while we sleep. */
  	csw = dev->si_devsw;
  	dev->si_devsw = NULL;	/* already NULL for SI_ALIAS */
  	while (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) {
 @@ -683,10 +684,15 @@
  	}
  	dev->si_flags &= ~SI_ALIAS;
  
 -	if (dev->si_refcount > 0) {
 +	if (dev->si_refcount > 1) {
 +		dev->si_refcount--;
  		LIST_INSERT_HEAD(&dead_cdevsw.d_devs, dev, si_list);
  	} else {
 +		KASSERT(dev->si_refcount == 1,
 +		    ("destroy_devl unexpected refcount %d", dev->si_refcount));
 +		dev_unlock();
  		devfs_free(dev);
 +		dev_lock();
  	}
  }
  



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