From eugen@kost.svzserv.kemerovo.su  Thu Jun 14 23:45:31 2001
Return-Path: <eugen@kost.svzserv.kemerovo.su>
Received: from kost.svzserv.kemerovo.su (kost.svzserv.kemerovo.su [213.184.65.82])
	by hub.freebsd.org (Postfix) with ESMTP id E82F637B403
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 14 Jun 2001 23:45:27 -0700 (PDT)
	(envelope-from eugen@kost.svzserv.kemerovo.su)
Received: (from root@localhost)
	by kost.svzserv.kemerovo.su (8.11.3/8.11.3) id f5F6jMa00466;
	Fri, 15 Jun 2001 14:45:22 +0800 (KRAST)
	(envelope-from eugen)
Message-Id: <200106150645.f5F6jMa00466@kost.svzserv.kemerovo.su>
Date: Fri, 15 Jun 2001 14:45:22 +0800 (KRAST)
From: "Eugene B. Grosbein" <eugen@svzserv.kemerovo.su>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Mounted CD-ROM can be ejected in some cases
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         28166
>Category:       kern
>Synopsis:       Mounted CD-ROM can be ejected in some cases
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 14 23:50:01 PDT 2001
>Closed-Date:    Sat Oct 25 12:36:56 PDT 2003
>Last-Modified:  Sat Oct 25 21:30:20 PDT 2003
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
ISP Svyaz-Service
>Environment:
System: 4.3-STABLE FreeBSD 4.3-STABLE
acd0: CD-RW <SONY CD-RW CRX140E> at ata1-master using PIO4
amd is not running, if that is worth to mention

>Description:
	This is possible to eject mounted CD-ROM

>How-To-Repeat:

Insert any CD-ROM in drive. Then type:

	export CDROM=/dev/acd0c
	mount /cdrom
	cd /cdrom

Now CD-ROM is locked. 'Eject' button on the front panel of drive does not
work. Now type:
	umount /cdrom; cdcontrol eject

Filesystem is busy so umount failed. cdcontrol failed as well. But now
'Eject' button on the front panel of drive DOES work and CD-ROM is
ejected when you press 'Eject'. Note, that filesystem is still mounted.

>Fix:
	Unknown for me.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: ru 
Responsible-Changed-When: Fri Jun 15 00:31:33 PDT 2001 
Responsible-Changed-Why:  
Over to Mr. ATA. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28166 

From: Ruslan Ermilov <ru@FreeBSD.org>
To: "Eugene B. Grosbein" <eugen@svzserv.kemerovo.su>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/28166: Mounted CD-ROM can be ejected in some cases
Date: Fri, 15 Jun 2001 10:31:07 +0300

 This is also reproduceable on a recent 5.0-CURRENT system with
 ATAPI CD-ROM drive mounted on /cdrom except holding a reference
 on a top-level mount point (cd /cdrom) is not considered a BUSY
 condition, and ``cd /cdrom; umount /cdrom'' succeeds.  Also, an
 assorted bug that is only reproduceable in -CURRENT:
 
 (mount /cdrom; cd /cdrom/foo; while :; do umount /cdrom; done)
 panics within a few seconds.
 
 > Insert any CD-ROM in drive. Then type:
 > 
 > 	export CDROM=/dev/acd0c
 > 	mount /cdrom
 > 	cd /cdrom
 > 
 > Now CD-ROM is locked. 'Eject' button on the front panel of drive does not
 > work. Now type:
 > 	umount /cdrom; cdcontrol eject
 > 
 > Filesystem is busy so umount failed. cdcontrol failed as well. But now
 > 'Eject' button on the front panel of drive DOES work and CD-ROM is
 > ejected when you press 'Eject'. Note, that filesystem is still mounted.
 
 
 Cheers,
 -- 
 Ruslan Ermilov		Oracle Developer/DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age

From: Bruce Evans <bde@zeta.org.au>
To: "Eugene B. Grosbein" <eugen@svzserv.kemerovo.su>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/28166: Mounted CD-ROM can be ejected in some cases
Date: Fri, 15 Jun 2001 19:56:27 +1000 (EST)

 On Fri, 15 Jun 2001, Eugene B. Grosbein wrote:
 
 > >How-To-Repeat:
 > 
 > Insert any CD-ROM in drive. Then type:
 > 
 > 	export CDROM=/dev/acd0c
 
 This should be
 
 	export CDROM=/dev/cdrom
 
 to avoid inadvertently demonstating the bug that /dev/acd0c can be ejected
 while /dev/acd0a is mounted.
 
 > 	mount /cdrom
 > 	cd /cdrom
 > 
 > Now CD-ROM is locked. 'Eject' button on the front panel of drive does not
 > work. Now type:
 > 	umount /cdrom; cdcontrol eject
 > 
 > Filesystem is busy so umount failed. cdcontrol failed as well. But now
 
 I think you need to "cd /cdrom/subdir" to make the filesystem busy.  After
 only "cd /cdrom", the umount works for me.
 
 > 'Eject' button on the front panel of drive DOES work and CD-ROM is
 > ejected when you press 'Eject'. Note, that filesystem is still mounted.
 
 This is caused by cdcontrol issuing a CDIOCALLOW ioctl for 'Eject',
 and the acd driver permitting CDIOCALLOW on mounted drives.  I think
 CDIOCALLOW should be limited in the same way as CDIOCEJECT.
 
 The (scsi) cd driver understands these ioctls even less than the acd
 driver.  It always permits them.
 
 Bruce
 

From: Bruce Evans <bde@zeta.org.au>
To: "Eugene B. Grosbein" <eugen@svzserv.kemerovo.su>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/28166: Mounted CD-ROM can be ejected in some cases
Date: Fri, 15 Jun 2001 20:07:23 +1000 (EST)

 On Fri, 15 Jun 2001, I wrote:
 
 > This is caused by cdcontrol issuing a CDIOCALLOW ioctl for 'Eject',
 > and the acd driver permitting CDIOCALLOW on mounted drives.  I think
 > CDIOCALLOW should be limited in the same way as CDIOCEJECT.
 > 
 > The (scsi) cd driver understands these ioctls even less than the acd
 > driver.  It always permits them.
 
 PS: However, the cd driver understands the implicit CDIOCALLOW at last-close
 time.  With the acd driver, just opening and closing an alias is sufficient
 to break the locking of the eject button:
 
     mount /dev/acd0a /mnt
     # Eject button does not work now.
     dd if=/dev/acd0c of=/dev/null bs=2k count=1
     # Eject button works now.
 
 Bruce
 

From: Eugene Grosbein <eugen@www.svzserv.kemerovo.su>
To: Bruce Evans <bde@zeta.org.au>
Cc: "Eugene B. Grosbein" <eugen@svzserv.kemerovo.su>,
	FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/28166: Mounted CD-ROM can be ejected in some cases
Date: Fri, 15 Jun 2001 18:58:27 +0800

 Bruce Evans wrote:
 
 > >       mount /cdrom
 > >       cd /cdrom
 > >
 > > Now CD-ROM is locked. 'Eject' button on the front panel of drive does not
 > > work. Now type:
 > >       umount /cdrom; cdcontrol eject
 > >
 > > Filesystem is busy so umount failed. cdcontrol failed as well. But now
 > 
 > I think you need to "cd /cdrom/subdir" to make the filesystem busy.  After
 > only "cd /cdrom", the umount works for me.
 
 It fails for me. My 4.3-STABLE is a bit old.
 
 Eugene Grosbein
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Wed Dec 12 06:02:48 PST 2001 
State-Changed-Why:  
Fixed in -current, MFC will follow. 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28166 
State-Changed-From-To: closed->patched 
State-Changed-By: schweikh 
State-Changed-When: Thu Aug 7 09:38:42 PDT 2003 
State-Changed-Why:  
Apparently the MFC has not yet happened (see also PR 55344) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=28166 
State-Changed-From-To: patched->closed 
State-Changed-By: sos 
State-Changed-When: Sat Oct 25 12:36:29 PDT 2003 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=28166 

From: Eugene Grosbein <eugen@kuzbass.ru>
To: "Sren Schmidt" <sos@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/28166: Mounted CD-ROM can be ejected in some cases
Date: Sun, 26 Oct 2003 11:26:57 +0700

 "Sren Schmidt" wrote:
 
 > Synopsis: Mounted CD-ROM can be ejected in some cases
 > 
 > State-Changed-From-To: patched->closed
 > State-Changed-By: sos
 > State-Changed-When: Sat Oct 25 12:36:29 PDT 2003
 > State-Changed-Why:
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=28166
 
 Is this PR closed because MFC has appeared? Thank you then!
 
 Eugene Grosbein
>Unformatted:
