From owner-freebsd-current@FreeBSD.ORG Fri Jul 27 00:40:08 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D9E716A41B for ; Fri, 27 Jul 2007 00:40:08 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by mx1.freebsd.org (Postfix) with ESMTP id 34EB013C4D0 for ; Fri, 27 Jul 2007 00:40:07 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by ug-out-1314.google.com with SMTP id o4so693858uge for ; Thu, 26 Jul 2007 17:40:07 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=P1Q3GiZY5PypgGH8wixCq52KjwS735xeuvUsXPgcBkAcvxw2vh5w8j1sJuF60k2hjUTe7PN2leLnO6Yg1xEEobYQDV7AFKqSw6GEqlYipySgeqMMmsgSN4t2jxWWoqTyZt4XY8tuFLTXIVsfueqgQFMiN6p7+a7ti3LcOYMnNL4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=n3yEaLNCZPXncfDRUNXOrsCzbWU0b2Kw+8Bql9OJ6HfmBVyAPxMxorQ/kLd/Vs4UBOt3t2/vGaC7dQAQ2wGzI9jPd5bN0qsLPgshqu2XRXeP7DPmItwUJChNP2UQZkvTgT+3herFSy0OH8giDKLy3TyAKqaBUBO3EmhtP5mSJHM= Received: by 10.86.60.7 with SMTP id i7mr1579369fga.1185495102852; Thu, 26 Jul 2007 17:11:42 -0700 (PDT) Received: by 10.86.31.8 with HTTP; Thu, 26 Jul 2007 17:11:42 -0700 (PDT) Message-ID: Date: Thu, 26 Jul 2007 17:11:42 -0700 From: "Maksim Yevmenkin" To: "Julian Elischer" , freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: nmdm(4) does not call .l_close X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 00:40:08 -0000 Dear All, it seems to me that nmdm(4) is not calling .l_close (i.e. does not close whatever line discipline might be installed onto /dev/nmdmXX). the problem is easy to reproduce - just open /dev/nmdm0A and install, say, ng_tty(4) line discipline onto it. after that, simply close the /dev/nmdm0A. in theory, the ng_tty(4) node should disappear when device is closed, but it does not. the following patch fixes things for me === beetle% diff -u nmdm.c.orig nmdm.c --- nmdm.c.orig 2006-11-21 16:59:40.000000000 -0800 +++ nmdm.c 2007-07-26 17:01:47.000000000 -0700 @@ -402,7 +402,7 @@ nmdmclose(struct cdev *dev, int flag, int mode, struct thread *td) { - return (tty_close(dev->si_tty)); + return (ttyclose(dev, flag, mode, td)); } static void === please review and let me know if this is ok to commit. please ignore tabs-to-spaces conversion. its just cut-and-paste from the screen. thanks, max p.s. i also think ng_tty(4) should use NG_NODE_REVIVE() is its not dying.