"Christopher W. Curtis" wrote:
>
> Hi,
>
> I'm running AutoFS as distributed with debian (version 3.1.4-4) and was
> intrigued by RMS's post to LKML
> (http://kt.linuxcare.com/kernel-traffic/kt20000626_73.epl#3). I asked
> him why AutoFS would not suffice and he basically said he didn't know
> enough about it, but heard others say it was not. I was writing him
> back and found that he's right. In order to have "DOS Style Floppy
> Handling", I think AutoFS needs to be modified, and possibly the Linux
> kernel as well.
>
> The three things that DOS does that makes it easy for users is:
> 1) Auto-mount the floppy upon request
> 2) Write synchronously to the floppy
> 3) Auto-unmount upon ejection
>
Autofs can't do #3. It is better handled by a proxying driver at the
block system layer. Also, autofs will do #1 at access time, rather than
at insertion time which is really the proper way to do it (you also want
to notify your GUI file mangler.)
In short, you want supermount.
> AutoFS handles automounting (/var/autofs/misc/floppy under debian) but
> not fully, because the floppy is always mounted as root, preventing the
> user from using the floppy. This could be worked around by making the
> floppy world writable, or creating a special 'diskette' group, but these
> are cumbersome compared to what *should* be possible: UID
> substitution. If we could specify "floppy -fstype=auto,sync,uid=$UID"
> in auto.misc, condition 1 would be satisfied.
>
> Condition 2 is satified by the "sync" option (which debian does not
> include). Investigation and experimentation confirm that the option
> "nosuid" MUST also be specified on all removable media. This is not an
> AutoFS problem, but it should be WRITTEN IN BOLD in the documentation if
> not already, and the man page should be updated to reflect this.
> autofs(5) currently gives, as example,
>
> floppy -fstype=auto :/dev/fd0
>
> I *HIGHLY* recommend this be changed to the following:
>
> floppy -fstype=auto,nosuid :/dev/fd0
>
You need nodev as well.
> with appropriate documentation to the danger of not including this
> option on devices like floppy disks.
>
> (This man page may not be part of the official AutoFS distribution;
> Cc:ing author directly.)
>
> Condition 3 needs a VFS hook, I believe. Yes, autofs will auto unmount
> after a specific amount of time, but after ejecting the floppy, I can
> still do a 'ls'. The buffer cache should be cleared when it is ejected,
> and I believe the VFS gets this signal. It does when a CD-ROM is
> inserted/ejected for sure. Even if I replace the floppy with another,
> this cache remains intact, which is then just wrong.
>
> Do these changes seem reasonable, and if a VFS change is required,
> possible before the release of kernel 2.4?
>
Not a chance in hell. Putting it in the VFS would slow down *every
access*, even to non-removable devices.
-hpa
--
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt