[illumos-Developer] [REVIEW] 260 some drivers erroneously discount a major of 0

Richard Lowe richlowe at richlowe.net
Mon Sep 27 22:36:56 PDT 2010


I'd like review of:
   260 some drivers erroneously discount a major of 0

webrev: http://richlowe.net/webrevs/il-maj0/

This bug is the same as: 
  6975280 t_kopen() fails if transport major device = 0

As noted in the bug (#260), the change to add_drv prevents major 0 being
given to drivers (it means, for new images, major numbers will start
from 1), this is due to the impossibility of auditing every driver for
assumptions regarding (dev_t)0 (especially those from 3rd parties), and
the apparently fairly widespread assumption that such a dev_t is
invalid.  The only code I found with such assumptions is t_kopen, and in
addition sv, as mentioned in the bug.

I've tested this via add_drv -b, with an empty name_to_major, to verify
that the first driver it adds gets major 1, with a partially complete
name_to_major, to make sure that the 'gap' at 0 is not filled, and by
wiring tcp(7D) to major 0 to test the circumstances mentioned in 6975280
(both before and after).

I have not yet found a good way to test 'sv', though the change seems
obvious I'm entirely willing to (and would prefer to) revert it, unless
a volunteer can come up with a reasonable way to test it.  You would
need the device underlying sv to have both a major and minor number of
0.

Garrett has already looked at this, and given some general sense of
assent.

If you plan to look at this but require more time, please say so,
so that I know to wait for you.

-- Rich



More information about the Developer mailing list