Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Aug 2002 19:40:04 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-scsi@FreeBSD.org
Subject:   Re: kern/15608: acd0 / cd0 give inconsistent errors on empty tray open()
Message-ID:  <200208230240.g7N2e4vp040559@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/15608; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: "M. Warner Losh" <imp@bsdimp.com>
Cc: ken@kdm.org, <johan@FreeBSD.ORG>, <nsayer@quack.kfu.com>,
	<freebsd-gnats-submit@FreeBSD.ORG>, <freebsd-scsi@FreeBSD.ORG>,
	<freebsd-standards@FreeBSD.ORG>, <sos@FreeBSD.ORG>
Subject: Re: kern/15608: acd0 / cd0 give inconsistent errors on empty tray
 open()
Date: Fri, 23 Aug 2002 12:41:28 +1000 (EST)

 On Thu, 22 Aug 2002, M. Warner Losh wrote:
 
 > In message: <20020822150931.A10866@panzer.kdm.org>
 >             "Kenneth D. Merry" <ken@kdm.org> writes:
 > : So is there any opinion on -standards as to what sort of error we should
 > : return on open if there is no media in a drive?
 >
 > EIO means "The device is there, but the driver had problems
 > interacting with it" while ENXIO means "the device isn't there at
 > all."  As such, EIO is the more correct error to return in this case.
 
 No, EIO means that an input/output arror occurred.  open.2 only documents
 EIO for creating files.  Otherwise open() normally doesn't do any i/o.
 So ENXIO is the more correct error.
 
 I think the bug is that the open doesn't succeed.  The device is
 reported as being there at boot time, and there is enough of it there
 to tell which parts of it aren't there, so why not open() it so that
 you do things like ioctl() on it to close its door and make it there?
 
 > I don't know if the standards speak to this specific issue (no or bad
 > media in a device with removable media).
 
 POSIX doesn't say anything much different from open.2 about this.
 
 Bruce
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208230240.g7N2e4vp040559>