Re: devfs v136, ZIP disks and glibc-2.1.2

Richard Gooch (rgooch@ras.ucalgary.ca)
Sun, 7 Nov 1999 11:49:48 -0700


German Jose Gomez Garcia writes:
> Hello Richard,
>
> I write this to report some strange things (bugs?) about
> the way devfs manages removable devices. When I try to mount
> a disk which is not partitioned in the same way that the last one
> inserted in the ZIP the kernel would create a new entry under
> /dev/discs and report that that device is already registered
> (both the whole disk and the partition), also it won't change
> the info until I read from the directory, that is, trying to mount
> it directly with for example:
>
> mount /dev/discs/disc2/part4 ...
>
> won't work if the last disk inserted have no part4, but if I
> make
>
> ls /dev/discs/disc2
>
> the kernel register the new partition scheme but it also register
> a new device
>
> /dev/discs/disc3
>
> and it would keep doing that always I change the disc so I have
> lots of /dev/discs/disc? every of them pointing to
>
> /dev/scsi/host0/bus0/target2/lun0
>
> and some messages like:
>
> devfs: devfs_register(): device already registered: "disc"
> devfs: devfs_register(): device already registered: "part4"

Yeah, minor thinko. I got one case but not the other. I've sent you
(privately) a new patch. Please try it and let me know (privately) if
it fixes the problem.

> The new glibc-2.1.2 uses some kind of "horrible hack" to
> check if /dev/pts is mounted (in order to getpt() to use the
> UNIX98 ttys) it checks both for the presence of /dev/pts but also
> for its magic, the next code is extracted from
[...]

Puke! That's unbelievably ugly. Not only doesn't it work for devfs,
but it would also fail if you had some kind of daemon populating
/dev/pts. I think the right solution is something along the lines that
Stephan suggested: have libc speculatively try a Unix98 pty and if it
fails, set a flag for future reference and fall back to BSD ptys.

If the glibc people don't want to do a speculative test, then add a
similar hack for devfs. If the magic number for /dev is 0x1373 and
/dev/pts exists, then Unix98 ptys are available. This would be no more
ugly than what's there already.

Regards,

Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/