Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jul 2007 17:51:32 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: nmdm(4) does not call .l_close
Message-ID:  <46A94194.5010207@elischer.org>
In-Reply-To: <bb4a86c70707261711h38d41b05k183c3fce84ba0b30@mail.gmail.com>
References:  <bb4a86c70707261711h38d41b05k183c3fce84ba0b30@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Maksim Yevmenkin wrote:
> 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.

when I originally wrote this I copied what the pty code was doing.
This has all been redone since then however.
I'm guessing it should do whatever the pty code is now doing :-) .

> 
> 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));

sounds believable..
but I don't really know offhand.
does it work with other disciplines?

>  }
> 
>  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.
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"




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