Side note: the propery way to fix this (IMHO) is to implement Media Status
Notification in the ide-floppy driver, so that the driver will be aware when
the user inserts and removes media from the device. This, however, will not
be practical (although possibly) until Andre's new IDE drivers get merged
into the kernel, since they provide clean and simple taskfile support (and
Media Status Notification requires using ATA, not ATAPI, commands, which are
hard to handle with the current ide driver subsystem).
In the meantime, I have already forwarded patches to Richard to do exactly
what you have suggested (create/remove the "disc" entries regardless of
whether media is present). With those entries available, it would be a
simple matter to issue a revalidate IOCTL from userspace when appropriate
(just before you make a mount attempt). Note that my patches also address
other issues, like when you change media and the old partX entries don't
disappear properly (not as big a problem, granted, but still worth fixing).
----- Original Message -----
From: "Paul Bristow" <paul@xxxxxxxxxxxxxxx>
To: <devfs@xxxxxxxxxxx>
Sent: Tuesday, December 04, 2001 2:43 AM
Subject: Removeable Media, partitions and devfs?
> Hi everyone,
>
> I have spent three entire days trying to work out what can be done to
> the ide-floppy driver to fix the problems people are having with devfs.
> However, as far as I can tell, the driver is working correctly, but
> the behaviour is not user-friendly.
>
> The problem is simple. If there is no disk in the drive when the driver
> is loaded, then no device nodes are created. The device nodes are
> actually created by the grok_partitions call in fs/partitions/check.c.
>
> The grok_partitions will create the disc node and any partitions IF
> there is a disk present.
>
> Most people with Zip drives have the entry /dev/hdx4 -> /mnt/zip in
> their fstab. The effect is that, if the driver was loaded with no disk
> in the drive, no nodes are created, and hence the mount attempt fails
> with a "device not found" error. If the driver is compiled as a module,
> you can rmmod and insmod with a disk inserted. If the driver is
> compiled in, you have to reboot.
>
> I could screw up the grok_partitions to always create a disc entry, but
> that won't actually help, unless I also create a part4 entry. This way
> madness lies.
>
> Is there a way within devfs to get a mount attempt to cause a
> revalidate_disc to be called when the relevant device directory is
> scanned? In the ide-floppy driver this would be the
> /host/bus/target/lun folder...
>
> This way fixes it with no changes to grok_partitions or the drivers, and
> should work for all removeable media.
>
> --
>
> Paul
>
> ide-floppy maintainer for devfs
>
> Email: paul@xxxxxxxxxxxxxxx
> Web: http://paulbristow.net
> ICQ: 11965223
>
>
>
>
>
|