Subject: port-i386/19611: amd(8) does not manage well removable media
To: None <gnats-bugs@gnats.netbsd.org>
From: None <sobrado@acm.org>
List: netbsd-bugs
Date: 12/30/2002 11:32:54
>Number:         19611
>Category:       port-i386
>Synopsis:       amd(8) does not manage well removable media
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 30 11:33:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Igor Sobrado
>Release:        1.6
>Organization:
University of Oviedo
>Environment:
NetBSD ns1.localnet 1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep  8 19:43:40 UTC 2002
     autobuild@tgm.daemon.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC i386

>Description:
The automounter does not manage well removable media (cd-roms).
I have set-up the automounter daemon using the example scripts
provided with the operating system.  I have not problems mounting
media (for example setting /cd/drive0 as my current directory),
but the media is not locked.  That means that I can go out of
this directory (cd /) and eject the cd-rom (eject cdrom).

It looks like the right behaviour, but the entry to /cd/drive0
must be manually removed with an "amq -u /cd/drive0".

>How-To-Repeat:
1.  set-up the automounter daemon with the example scripts.
2.  insert an ISO-9660 cdrom in the drive 0.
3.  cd /cd/drive0  /* the cdrom is automatically mounted */
4.  cd /
5.  eject cdrom    /* the /cd/drive0 entry is NOT removed from amq */

amd(8) becomes unusable.  We can recover its normal behaviour making:

6.  amq -u /cd/drive0
>Fix:
I left the right fix to the NetBSD developers.  NetBSD is a fine
and very well designed operating system.  I can not decide what
the right behaviour is.  Some proposals:

a.  Locking the device in a way that it cannot be ejected before
    running "amq -u /cd/drive0" (step 6)

b.  Automatically removing the entry for that device from amq
    once it has been ejected (for example with an "eject cdrom")

What is clear to me, is that we should not be able to eject
removable media in a way that it looks as mounted to amd(8).
In short, either locking the device when it is under the control
of the automounter or removing the entry shown in amq when it is
ejected seems ok.

Cheers,
Igor.

>Release-Note:
>Audit-Trail:
>Unformatted: