Bug 7922 - dynamic device major number allocation conflicts with local/experimental range
Summary: dynamic device major number allocation conflicts with local/experimental range
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: fs_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-02 04:38 UTC by Tomas Klas
Modified: 2007-02-02 14:26 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.20
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Tomas Klas 2007-02-02 04:38:30 UTC
__register_chrdev_region in fs/char_dev.c uses major device numbers numbers from
254 down for dynamic allocation, but this range is reserved for
"local/experimental use" in LANANA Device List.

quote from "http://www.lanana.org/docs/device-list/devices-2.6+.txt":
--------
240-254 char	LOCAL/EXPERIMENTAL USE
240-254 block	LOCAL/EXPERIMENTAL USE
		Allocated for local/experimental use.  For devices not
		assigned official numbers, these ranges should be
		used in order to avoid conflicting with future assignments.
--------

I wrote my "local/experimental" driver with major 253, to "avoid conflicting
with future assignments", all works fine. Then I select some new fetures etc.
and vuala, major 253 is now allocated by usb_endpoint.

Please exclude local/experimental range from dynamic allocation, or add some
notice to device list.
Comment 1 Tomas Klas 2007-02-02 04:59:41 UTC
I think better range for dynamic allocation are unused numbers 231-239.

--- char_dev.c  2007-02-02 14:03:24.000000000 +0100
+++ char_dev1.c 2007-02-02 14:03:14.000000000 +0100
@@ -109,3 +109,3 @@
        if (major == 0) {
-               for (i = ARRAY_SIZE(chrdevs)-1; i > 0; i--) {
+               for (i = 231; i <= 239; i++) {
                        if (chrdevs[i] == NULL)
Comment 2 Andrew Morton 2007-02-02 14:26:51 UTC
I queued a patch, thanks.

Note You need to log in before you can comment on or make changes to this bug.