Re: [PATCH] new system call mknod64

Linus Torvalds
2003-04-21T18:23:28Z

On Mon, 21 Apr 2003 viro@parcelfarce.linux.theplanet.co.uk wrote:
> > I personally think that anything that uses "dev_t" in _any_ other way than
> > <major,minor> is fundamentally broken.
>
> Do you consider internal use of MKDEV-produced constants broken?

Since they are always in canonical format, there is no way for them to
have the aliasing issue. However, even then they _should_ be careful,
since it would be very confusing (and bad) if they consider

0x00010100 (major 1, minor 256)

to be fundamentally different from

0x01ff (major 1, minor 255)

and cause problems that way.

In other words, if I'm a device driver, and I say that I want "range
0-0xfff" for "major 2", then I had better get _all_ of it. That means that
I'd better get

0x0200-0x02ff

_and_

0x00020100-0x00020fff

and quite frankly, I think that ends up being a lot easier to handle if
you just always consider it to be a <major,minor> split.

(but as long as the end result is equivalent, who cares?)

Linus