nmdm(4) does not call .l_close

From: Maksim Yevmenkin <maksim.yevmenkin_at_gmail.com>
Date: Thu, 26 Jul 2007 17:11:42 -0700
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
_at__at_ -402,7 +402,7 _at__at_
  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.
Received on Thu Jul 26 2007 - 22:40:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:15 UTC