Re: SCSI disk naming
Sat, 12 Jul 1997 23:14:18 +0200

Matthias Urlichs:

: What we really need are longer device numbers in all file systems, esp.
: ext2 of course.

They are there already - I have run a system with large device
numbers in 1995 and again this year until recently (on ext2), both times
giving up when newer patches conflicted too heavily.
(E.g., 2.1.44 has two new system calls [sg]etresgid,
conflicting with my new stat calls, and there were other
conflicts in very recent 2.1 kernels.)

: Everything else is (more or less) taken care of -- glibc
: already has large device numbers, a new kernel stat() system call version
: is easy to do


: ditto for extending the kernel's idea of dev_t


: all the old code should work OK as long as you don't need devices
: with minor>255.

: The real compatibility problem is stuff like "check if /path/to/a and
: /path/too/to/b point to the same file" -- suppose you want to copy one
: to the other, a is on 08/01 and b is on 08/101 (i.e. SCSI disk #17),
: and both have inode 56...

I am not sure I follow you - surely nobody wants to truncate
device numbers. If I recall correctly I made stat() return EOVERFLOW
or so when called with an old-fashioned stat structure on a file
that required a larger st_dev or st_rdev field.

On the other hand, there still *is* (a little bit of) real work to do;
many static arrays in the kernel, addressed by major nr,
must be replaced by dynamically allocated ones.
But that is not bad - in fact a lot of code involving things like
becomes shorter, faster, and much more beautiful.
Then there is the handling of a device for which no driver is
known or needed. The old dev_t is no good because it does not
contain bdev/cdev information and hence does not identify the
device, and the new kdev_t is no good because perhaps no device
structure exists. Various solutions are possible, like ignoring
the problem (my 1st version), and introducing another type idev_t
containing the device number and the bdev/cdev bit (my 2nd version).

A few months ago I started again feeding Linus patch fragments
intended to convert the kernel to long device numbers
in a number of small steps, all the time keeping a
well-functioning system, following up on the work begun in 1995.
However, at that moment he had no time for such frivolities
and asked me to come back later. Right now I can see obligations
abroad until the second week of October, so if nobody else does
the work before that time (it really is very little and the lack
of long device numbers is hurting more and more people ...), I hope
to start submitting some patch fragments again sometime in October.