DragonFly BSD
DragonFly bugs List (threaded) for 2006-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Fix nagging make_dev() warnings

From: "Frank W. Josellis" <frank@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 24 Sep 2006 14:32:33 +0200 (CEST)

An inspection of sys/kern/tty_cons.c shows that the reported replacement 
"sc" -> "intercept" is indeed intentional. It just means that the dev_ops 
has been substituted as desired. Then, however, requiring

[*]	(si->si_ops == ops && si->si_udev == udev)

in hashdev() looks inappropriate, as this prevents the intercepted device 
from being successfully looked up from the hash table. Strictly speaking, 
dev_ops_get(12,255) returns the ops of the original device, and this is 
used by udev2dev() for a subsequent hashdev() call. As a consequence one 
has si_ops != ops and [*] is not matched. Once the interception is 
established, the next attempt to open consolectl thus results in the 
creation of a new device whose si_ops is the original one. This effects 
a complete bypassing of the intercepted device.

I can't figure out why the condition "si->si_ops == ops" in [*] had been 
added. For testing purposes I dropped this to see what goes wrong, but 
everything still looks fine. Anyway, in view if the new intercept code it 
appears that here is a point which should be reconsidered.

Frank Josellis

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]