devfs v136, ZIP disks and glibc-2.1.2

German Jose Gomez Garcia (german@pinon.ccu.uniovi.es)
Sun, 07 Nov 1999 16:08:21 +0100 (MET)


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"

And more things:

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

glibc-2.1.2/sysdeps/unix/sysv/linux/getpt.c

--------------------------------------------------------------------
#define DEVPTS_SUPER_MAGIC 0x1cd1

....

/* Check that the /dev/pts filesystem is mounted. */
if (devpts_mounted
|| (__statfs (_PATH_DEVPTS, &fsbuf) == 0
&& fsbuf.f_type == DEVPTS_SUPER_MAGIC))
{
/* Everything is OK. */
devpts_mounted = 1;
return fd;
}
--------------------------------------------------------------------

as you can see Drepper check for that DEVPTS_SUPER_MAGIC, I have no idea
where it comes from (maybe some POSIX knowledge here would be useful).
But using devfs the /dev/pts dir has no such f_type (it have 0x1373)
I have no checked without devfs but it seems that your patch doesn't
touch anything having to do with such magic number (or at least
'grepping' for it in your patch returns nothing :-), I have currently patched
my glibc version but I don't know if the correct thing is to send a
patch to Drepper or change something in the kernel, any POSIX guru here
who knows if that DEVPTS_SUPER_MAGIC is "official" ?

- german

<>-------------------------------------+-----------------------------------<>
One O.S. to rule them all, | German Gomez Garcia
One O.S. to find them. | german@pinon.ccu.uniovi.es
One O.S. to bring them all |
and in the darkness bind them. | "Wur Qanar Wur Stilor Wur Kas"
<>-------------------------------------+-----------------------------------<>

-
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/