NetBSD Problem Report #19611

Received: (qmail 16372 invoked by uid 605); 30 Dec 2002 19:32:56 -0000
Message-Id: <20021230193254.AE31511125@narn.netbsd.org>
Date: Mon, 30 Dec 2002 11:32:54 -0800 (PST)
From: sobrado@acm.org
Sender: gnats-bugs-owner@netbsd.org
Reply-To: sobrado@acm.org
To: gnats-bugs@gnats.netbsd.org
Subject: amd(8) does not manage well removable media
X-Send-Pr-Version: www-1.0

>Number:         19611
>Category:       bin
>Synopsis:       amd(8) does not manage well removable media
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 30 19:33:00 +0000 2002
>Closed-Date:    
>Last-Modified:  Fri Jun 15 09:48:31 +0000 2007
>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:

From: Igor Sobrado <sobrado@string1.ciencias.uniovi.es>
To: gnats-bugs@netbsd.org
Cc:  
Subject: Re: port-i386/19611
Date: Tue, 07 Jan 2003 08:49:00 +0100

 To be more accurate: the cdrom drive is locked in the sense that the
 workstation/server user cannot eject the cdrom by pressing the eject
 button on the cdrom drive front panel.  A non-privileged user cannot
 eject the cdrom using "eject cdrom" once mounted in the default
 configuration, this action requires higher privileges.  Only a
 privileged account (root) is able to eject disks mounted by amd(8).

 The status of this report (serious/high) is obviously wrong.
 I assigned this status to the report because the automounter
 daemons fails to work when media is ejected as described in
 the PR, but at same time I provide a workaround to allow amd(8)
 recovering the control of removable media (using amq(8) on the
 unmounted device).

 Igor.

 -- 
 Igor Sobrado, UK34436 - sobrado@acm.org
From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@netbsd.org
Cc: Igor Sobrado <sobrado@string1.ciencias.uniovi.es>,
	Hauke Fath <hf@spg.tu-darmstadt.de>
Subject: Re: port-i386/19611 - amd(8) does not manage well removable media
Date: Tue, 06 Sep 2005 15:20:39 +0200

 Two comments:

 (1) The PR should be assigned to 'bin', not 'port-i386'.

 (2) The PR is really against eject(1) which unmounts removable media if 
 it was mounted before ejecting - something that amd does not like when 
 it owns the mount.

 IMHO, the proper fix would be: Teach eject(1) to check if the mount in 
 question is administrated by amd(8). If yes, amq -u the mount, and if 
 that doesn't work because of open files then do not eject, and error 
 out. A tool for listing who has files open below a directory would be 
 nice to have in the NetBSD distribution (lsof?).

 There is an 'am-eject' script in the am-utils distribution but that is 
 horribly broken, and has it backwards because it wraps eject(1).

 	hauke

 -- 
 /~\  The ASCII Ribbon Campaign                    Hauke Fath
 \ /    No HTML/RTF in email	        Institut für Nachrichtentechnik
   X     No Word docs in email	                  TU Darmstadt
 / \  Respect for open standards              Ruf +49-6151-16-3281

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: port-i386-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: port-i386/19611 - amd(8) does not manage well removable media
Date: Tue, 6 Sep 2005 23:21:20 +0200

 On Tue, Sep 06, 2005 at 01:21:01PM +0000, Hauke Fath wrote:
 >  [...]
 >  out. A tool for listing who has files open below a directory would be 
 >  nice to have in the NetBSD distribution (lsof?).

 fstat(1) does this.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Igor Sobrado <igor@string1.ciencias.uniovi.es>
To: gnats-bugs@netbsd.org
Cc: Hauke Fath <hf@spg.tu-darmstadt.de>
Subject: Re: port-i386/19611 - amd(8) does not manage well removable media
Date: Thu, 29 Dec 2005 19:12:02 +0100

 Hi, Hauke.

 You are absolutely right.  I usually have *serious* challenges chosing
 the right category for a problem report, I must admit... but certainly
 classifying this PR as "port-i386" is one of the biggest mistakes I did!

 Can someone, please, assign this PR to 'bin' instead?  Thanks!

 Agreed, the problem is really the way eject(1) manages removable
 media mounted using amd(8).  A very good point!

 Cheers,
 Igor.

Responsible-Changed-From-To: port-i386-maintainer->bin-bug-people
Responsible-Changed-By: hauke@netbsd.org
Responsible-Changed-When: Fri, 15 Jun 2007 09:48:31 +0000
Responsible-Changed-Why:
Submitter agreed that this is amd(8) related and thus not machine specific.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.