From owner-freebsd-scsi@FreeBSD.ORG Mon Jan 26 17:28:08 2004 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E08E816A4CE for ; Mon, 26 Jan 2004 17:28:08 -0800 (PST) Received: from smtp.covadmail.net (mx08.covadmail.net [63.65.120.68]) by mx1.FreeBSD.org (Postfix) with SMTP id DB65C43D9B for ; Mon, 26 Jan 2004 17:27:11 -0800 (PST) (envelope-from strick@covad.net) Received: (covad.net 11049 invoked from network); 27 Jan 2004 01:26:45 -0000 Received: from unknown (HELO mist.nodomain) (strick@covad.net@68.164.174.1) by sun-qmail12 with SMTP; 27 Jan 2004 01:26:45 -0000 Received: from mist.nodomain (localhost [127.0.0.1]) by mist.nodomain (8.12.9p2/8.12.9) with ESMTP id i0R1Qmhn000464; Mon, 26 Jan 2004 17:26:48 -0800 (PST) (envelope-from dan@mist.nodomain) Received: (from dan@localhost) by mist.nodomain (8.12.9p2/8.12.9/Submit) id i0R1QmCW000463; Mon, 26 Jan 2004 17:26:48 -0800 (PST) (envelope-from dan) Date: Mon, 26 Jan 2004 17:26:48 -0800 (PST) From: Dan Strick Message-Id: <200401270126.i0R1QmCW000463@mist.nodomain> To: ken@FreeBSD.org cc: nsayer@quack.kfu.com cc: scsi@FreeBSD.org Subject: Re: kern/15608: acd0 / cd0 give inconsistent errors on empty tray open() X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2004 01:28:09 -0000 >> > Synopsis: acd0 / cd0 give inconsistent errors on empty tray open() > > State-Changed-From-To: feedback->closed > State-Changed-By: ken > State-Changed-When: Mon Jan 26 11:59:35 PST 2004 > State-Changed-Why: > Bruce said that ENXIO was the correct error to return, and we do return > that when media isn't present. Also, I believe that the issues that Bruce > brought up about the CDIOCCLOSE ioctl, etc., have been fixed. > > > Responsible-Changed-From-To: scsi->ken > Responsible-Changed-By: ken > Responsible-Changed-When: Mon Jan 26 11:59:35 PST 2004 > Responsible-Changed-Why: > Bruce said that ENXIO was the correct error to return, and we do return > that when media isn't present. Also, I believe that the issues that Bruce > brought up about the CDIOCCLOSE ioctl, etc., have been fixed. > > http://www.freebsd.org/cgi/query-pr.cgi?pr=15608 >> ENXIO would be historically the correct error to return for nonexistant disk media, including an attempt to begin a read/write one or more sectors beyond the end of a disk. This should also be the error returned for an attempt to begin a read one or more sectors beyond the last written sector of a write-once medium (e.g. CD-R) though this might be difficult situation to recognize. It might be the correct error to return whenever a read produces a "blank check" though one might sometimes make a good argument for EIO in that situation. Of course, a read that begins at or before the end of the medium but extends past the end should simply result in a short read. I mention this because it works on FreeBSD with CD-ROM but not with CD-R. I don't think I have tested this on the most recent FreeBSD releases so it might have been fixed. (This glitch, present in both scsi and atapi cd drivers, also triggered a bug in ata/atapi dma code that the ata driver eventually resolved by timing out waiting for dma to complete and disabling dma for the device.) Dan Strick strick@covad.net