| Summary: | Mounted CD-ROM can be ejected in some cases | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Eugene Grosbein <ports> |
| Component: | kern | Assignee: | Søren Schmidt <sos> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.3-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Eugene Grosbein
2001-06-15 07:50:01 UTC
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 Responsible Changed From-To: freebsd-bugs->sos Over to Mr. ATA. 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 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
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 Fixed in -current, MFC will follow. State Changed From-To: closed->patched Apparently the MFC has not yet happened (see also PR 55344) State Changed From-To: patched->closed "Søren 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
|