From owner-freebsd-bugs Wed Sep 27 19:30:11 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id TAA23791 for bugs-outgoing; Wed, 27 Sep 1995 19:30:11 -0700 Received: (from gnats@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id TAA23778 ; Wed, 27 Sep 1995 19:30:06 -0700 Resent-Date: Wed, 27 Sep 1995 19:30:06 -0700 Resent-Message-Id: <199509280230.TAA23778@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, "Received:from relay4.UU.NET (relay4.UU.NET [192.48.96.14]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id TAA23481 for" ; Wed, 27.Sep.1995.19:21:43.-0700 Received: from ast.com by relay4.UU.NET with SMTP id QQzjbt05496; Wed, 27 Sep 1995 22:22:03 -0400 Received: from trsvax.fw.ast.com (fw.ast.com) by ast.com with SMTP id AA23650 (5.67b/IDA-1.5 for ); Wed, 27 Sep 1995 19:23:02 -0700 Received: by trsvax.fw.ast.com (/\=-/\ Smail3.1.18.1 #18.1) id ; Wed, 27 Sep 95 21:22 CDT Received: by nemesis.lonestar.org (Smail3.1.27.1 #18) id m0sy8W1-0004w0C; Wed, 27 Sep 95 21:16 CDT Message-Id: Date: Wed, 27 Sep 95 21:16 CDT From: uhclem%nemesis@fw.ast.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/750: cd9660 confused by not-ready or I/O errors FDIV030 Sender: owner-bugs@freebsd.org Precedence: bulk >Number: 750 >Category: kern >Synopsis: cd9660 confused by not-ready or I/O errors FDIV030 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 27 19:30:03 PDT 1995 >Last-Modified: >Originator: Frank Durda IV >Organization: Hey Moe! This pipe is full of wires! >Release: FreeBSD 2.0.5-SNAP950726 i386 >Environment: A stock system with Matsushita CD-ROM (matcd0a), or SCSI CD-ROM (cd0a) that has a drive that allows media to be removed while mounted (including via emergency eject) >Description: If a mounted CD-ROM becomes not ready or returns other error codes associated with a media read error, or a media change or incompatible media error caused by incompatible media being loaded in place of compatible media (such as White or Red book vs Orange book HS/ISO), the cd9660 filesystem control layer will get in a state where it will not umount the device, and will keep the device mounted (but not usable) and the dev busy until the system is rebooted. >How-To-Repeat: Boot system Insert mountable (I used 2.0.5R CDROM) mount -t cd9660 /dev/your_scsi_device /mnt (I tried both with matcd0a and cd0a and both do the same thing) df (to confirm the device is listed as mounted) Now, eject the media, either by pressing the eject button, or if the drive is locked, use the emergency eject pin or tab. Remove 2.0.5R CD. Now, insert an audio CD into the player. Wait until the media has had ample time to come to speed and read the TOC. Allow 30 seconds. Now, type ls /mnt You should get one or more error messages. This is normal and the messages will vary with the drive type and driver. The ls command should abort. That is all normal. Now do a umount /dev/your_scsi_device I see: umount: /mnt: Input/output error That isn't a good thing. What is it waiting on? Writing the cache? :-) If you then do a df you will see that the file system is still mounted. So, you can't get the device unmounted at this point. Now remove the audio media in the drive, and replace the same disc you used earlier (2.0.5R in above example). Wait 30 seconds for it to become ready. Repeat the umount /dev/your_scsi_device still get: umount: /mnt: Input/output error (You can try another ls /mnt, but it won't work either.) At this point, that drive is dead, unusable until the system reboots. Attempting to issue a second mount for another mount point (say /mnt1) fails with "Device busy". A cat of the raw device also fails with a busy error. I originally stumbled into this by installing from the CD and was unaware that after rebooting, the 2.0.5 system silently mounted the 2.0.5R CD as part of the normal boot. It never occurred to me that this would happen. I then changed CDs to play an audio CD using xcdplayer, not knowing the device was mounted at this point, and ran into this very condition. First I ran xcdplayer and it complained about not being able to access the device, then I did a df and discovered the mount issue. Since not all drives (SCSI and otherwise) support and/or enforce door locking, it seems that cd9660 (or whatever is to blame) should not gag in this state and that a umount of a read-only file system should *always* work and close the dev. FYI, debug in the matcd driver shows that no open/close/read/ioctl calls are made to the driver at all after the first media change is discovered by the "ls" command, so the subsequent errors are all occurring somewhere above the driver. The driver never gets asked any more questions. >Fix: None known at this time. >Audit-Trail: >Unformatted: