From owner-cvs-all@FreeBSD.ORG Fri Nov 16 22:32:49 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C792316A418 for ; Fri, 16 Nov 2007 22:32:49 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 9219A13C459 for ; Fri, 16 Nov 2007 22:32:49 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 7591 invoked from network); 16 Nov 2007 22:32:50 -0000 Received: from 209-128-117-003.bayarea.net (HELO ?10.0.8.5?) (nate-mail@209.128.117.3) by root.org with ESMTPA; 16 Nov 2007 22:32:50 -0000 Message-ID: <473E1A76.1030207@root.org> Date: Fri, 16 Nov 2007 14:32:22 -0800 From: Nate Lawson User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Poul-Henning Kamp References: <29576.1195233852@critter.freebsd.dk> In-Reply-To: <29576.1195233852@critter.freebsd.dk> X-Enigmail-Version: 0.95.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.ORG, Scott Long , src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, =?ISO-8859-1?Q?S=F8ren_Schmidt?= Subject: Re: cvs commit: src/sys/dev/ata atapi-cd.c atapi-cd.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2007 22:32:49 -0000 Poul-Henning Kamp wrote: > In message <473DCF61.6010107@samsco.org>, Scott Long writes: > >>> What I've sortof talked phk into is that if I return the "right" error >>> code in the "start" function, it will back off and not retry nor chatter. >>> We still need the "access" function to return OK if HW present or we >>> cannot send ioctl calls to an empty drive. >>> >> IMHO, overloading g_start just adds more cruft to the problem. > > The fundamental problem is that the CDROM ioctls don't distinguish > between drive and media. > > In a nutshell: we are forced to let the open succeed, so the ioctl > to close the tray can be issued, before we can get at the media. > > The problem with letting the open (aka g_access) succeed, is that > the GEOM tasting starts. > > Redefining the ioctls is not a realistic option at this point, so > the task is to find a workaround for the API-deficiency. > > What sos@ and I talked about is that we need to have an error return > that says "The drive is here, but there is no media", to fail the > tasting without GEOM reporting I/O errors on the console. > > The simplest way to do this, is probably to overload ENOENT or some > other currently undefined errno for this effect. Well, there are two questions: media present (yes/no) and drive capable of telling if media present without just trying to read it (yes/no). For the latter question, a CDROM is yes and a floppy drive is no. For the latter, you need a third return code which is "I don't know, and only attempt a read if the user explicitly asked for it with a setting". Since boot-time automatic tasting is only needed if you're going to automount it, I doubt it's a huge inconvenience for users that want to automount a floppy to incur the couple seconds delay while it is probed. For the rest of us, we save boot time. Note that this wouldn't change the fact that tasting would occur synchronously once someone asked to mount a floppy. So any problem with making this change? -- Nate